Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Add TensorflowCustomBackend class from qibo #12

Merged
merged 45 commits into from
Nov 5, 2021
Merged

Add TensorflowCustomBackend class from qibo #12

merged 45 commits into from
Nov 5, 2021

Conversation

stavros11
Copy link
Member

Following qiboteam/qibo#500 this adds the TensorflowCustomBackend that was previously in qibo here. Since this class inherits the AbstractBackend from qibo, qibo is now added in the requirements list for qibotf.

@scarrazza I tried removing the requirements.txt similarly to what you did for qibo and qibojit but there seems to be an issue here. Is there another reason this file is required here? If yes, I will put it back and just add the qibo requirement there.

@scarrazza
Copy link
Member

@stavros11 thanks for this. Indeed, for this repository we need the requirements, given that tensorflow must be installed before running setup.py, and we use that file for the versioning control.

@codecov
Copy link

codecov bot commented Oct 27, 2021

Codecov Report

Merging #12 (444a4b3) into main (4116d05) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              main       #12    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            3         5     +2     
  Lines          371       528   +157     
==========================================
+ Hits           371       528   +157     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/qibotf/custom_operators/__init__.py 100.00% <100.00%> (ø)
...m_operators/python/ops/qibo_tf_custom_operators.py 100.00% <100.00%> (ø)
src/qibotf/tests/conftest.py 100.00% <100.00%> (ø)
src/qibotf/tests/test_gates.py 100.00% <100.00%> (ø)
src/qibotf/tests/test_ops.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4116d05...444a4b3. Read the comment docs.

@stavros11
Copy link
Member Author

@scarrazza, following what we discussed I removed the qibo requirement for testing. I also had to remove qibo from the requirements.txt for this to work, which I assume is okay, given that qibotf is "useless" for external users without qibo. Now CI tests seem to pass, however there is an issue with the build. Is this because qibo is required to build the wheels?

@scarrazza
Copy link
Member

@stavros11 thanks. No, I think this is related to auditwheels/py36.

@stavros11
Copy link
Member Author

I added some tests for TensorflowCustomBackend to get the coverage back to 100%. Similarly to qiboteam/qibojit#35 here I am installing qibo from source until the new backend independent version is released. I also had to disable Python 3.6.

@scarrazza, do you have any idea why pylint is failing here?

@scarrazza
Copy link
Member

@scarrazza, do you have any idea why pylint is failing here?

Should be the incompatibility you have fixed here: 024c165

@stavros11
Copy link
Member Author

Should be the incompatibility you have fixed here: 024c165

I am giving this another try but I believe this results to some other installation issues.

@scarrazza
Copy link
Member

I am giving this another try but I believe this results to some other installation issues.

@stavros11 just fixed now.

@stavros11
Copy link
Member Author

@stavros11 just fixed now.

Thanks for the fix. This should be good to go, we just need to remember to reset the CI to pip install qibo --pre and re-enable Python 3.6 once qibo is released.

@scarrazza
Copy link
Member

@stavros11 thanks, I am looking into py36 right now. The major issue we have is that some qibo dependency is asking for matplotlib 3.4 which is not compatible with py36, I am not sure which package is forcing that version, however if we can get rid or disable this requirement for qibo then we can retry this PR with an updated version of the backendcls branch.

@stavros11
Copy link
Member Author

stavros11 commented Nov 4, 2021

@stavros11 thanks, I am looking into py36 right now. The major issue we have is that some qibo dependency is asking for matplotlib 3.4 which is not compatible with py36, I am not sure which package is forcing that version, however if we can get rid or disable this requirement for qibo then we can retry this PR with an updated version of the backendcls branch.

I believe the py36 issue disappears if I install qibo using pip install . like you do here instead of python setup.py develop. I just pushed this in qiboteam/qibojit#35 and I think CI passes.

@scarrazza
Copy link
Member

Ok, I will have another look, the problem was raised from https://github.com/qiboteam/qibotf/runs/4092821511?check_suite_focus=true#step:5:235.

On the other hand looks like keras-2.7.0 is breaking the actions for qibo https://github.com/qiboteam/qibo/actions/runs/1421436395. If pinning down to 2.6.0 works then we will have to include this requirement here.

@scarrazza scarrazza self-requested a review November 5, 2021 09:14
@scarrazza scarrazza merged commit 12e9049 into main Nov 5, 2021
@scarrazza scarrazza deleted the backendcls branch November 5, 2021 10:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants