qiboteam / qibojit-benchmarks

Benchmark code for qibojit performance accessment
Apache License 2.0
2 stars 3 forks source link

Add the support for tensor network benchmarking #41

Open liweintu opened 1 year ago

liweintu commented 1 year ago

We add the support for the benchmarking of tensor network backend in simulation. First quimb, then cuQuantum.

liweintu commented 1 year ago

To add qibotn as a backend, there're two options.

  1. In .benchmarks/libraries/qibo.py, extend the Qibo class to support qibotn as a new backend.
  2. In .benchmarks/libraries/, create a new file qibotn.py to add qibo-supported TNet backends.

IMHO, if we want to package both state vector and TNet support into qibo, option 1 is favoured.

@AleCandido Which one do you recommend?

alecandido commented 1 year ago

Given that qibotn is somehow falling under the hat of Qibo, I would see option 1 as the favored alternative as well, exactly for the same reason you are arguing.

However, in this context I'm not an authoritative source, I believe we should ask for the opinion of @stavros11 (who mostly developed the benchmarks and a large part of Qibo itself), and of course @scarrazza.

liweintu commented 1 year ago

Given that qibotn is somehow falling under the hat of Qibo, I would see option 1 as the favored alternative as well, exactly for the same reason you are arguing.

However, in this context I'm not an authoritative source, I believe we should ask for the opinion of @stavros11 (who mostly developed the benchmarks and a large part of Qibo itself), and of course @scarrazza.

Sure, fair enough.

Hi @stavros11 , @scarrazza , do you have a suggestion about which option we should pick to incorporate TNet backends into the benchmarking? Thanks.

stavros11 commented 1 year ago

Hi @stavros11 , @scarrazza , do you have a suggestion about which option we should pick to incorporate TNet backends into the benchmarking? Thanks.

I think the idea of qibotn is that it will be an additional qibo backend (see for example qiboteam/qibotn#7), so I would also prefer option 1. Option 2 may be faster to implement now but integrating qibotn with qibo shouldn't be very hard either and doing so will also expose the new backend to all qibo users which could be useful for other applications (other than benchmarks).

I would suggest to give a try to implement the backend in the qibotn repository, for example following the qibojit numba backend or qibolab as template, but I can also provide more details and help with how to do this. This will be the first non-state vector simulator, so it will be a good exercise to see if our backend abstractions are sufficient to support it.

liweintu commented 1 year ago

Agreed, then we'll go ahead to follow qibojit backend as the template. Thanks for the suggestion @stavros11 .