Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.qiskit: 0.19.6 -> 0.20.0 & update components #95713

Merged
merged 11 commits into from Aug 25, 2020

Conversation

drewrisinger
Copy link
Contributor

Motivation for this change

Updates python3Packages.qiskit to v0.20.0, as well as updates all components.
Some components require new packages, which were added (muparserx, pythonPackages.yfinance (which requires pythonPackages.multitasking)).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohterwise LGTM

pkgs/development/python-modules/retworkx/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/retworkx/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/yfinance/default.nix Outdated Show resolved Hide resolved
Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, retworkx in python-modules needs to be changed since it's not a normal buildPythonPackage.

original:

  retworkx = callPackage ../development/python-modules/retworkx { };

correct:

  retworkx = toPythonModule(callPackage ../development/python-modules/retworkx { });

pkgs/development/python-modules/retworkx/default.nix Outdated Show resolved Hide resolved
@jonringer
Copy link
Contributor

do you mind looking at #95527 as well?

@drewrisinger
Copy link
Contributor Author

Addressed all comments. Building locally now. Only outstanding item IMHO is maybe running self-test on muparserx (WIP).

🤦 on changing retworkx = toPythonModule ..., did it in my nur-packages but forgot here... Fixed.

@drewrisinger drewrisinger force-pushed the dr-pr-python-qiskit-bump branch 4 times, most recently from 73610b2 to ed4dbb4 Compare August 17, 2020 22:17
@drewrisinger
Copy link
Contributor Author

OK. Worked out last few bugs.

  • pythonPackages.retworkx now properly works as python37Packages.retworkx, and is disabled for python27Packages.
  • muparserx is self-tested
  • all review comments addressed.
  • nix-review pr 95713 runs locally

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seeing some issues with aqua:

https://github.com/NixOS/nixpkgs/pull/95713
6 packages failed to build:
python37Packages.qasm2image python37Packages.qiskit python37Packages.qiskit-aqua python38Packages.qasm2image python38Packages.qiskit python38Packages.qiskit-aqua

20 packages built:
muparserx python27Packages.multitasking python27Packages.pylatexenc python27Packages.yfinance python37Packages.multitasking python37Packages.pylatexenc python37Packages.qiskit-aer python37Packages.qiskit-ibmq-provider python37Packages.qiskit-ignis python37Packages.qiskit-terra python37Packages.retworkx python37Packages.yfinance python38Packages.multitasking python38Packages.pylatexenc python38Packages.qiskit-aer python38Packages.qiskit-ibmq-provider python38Packages.qiskit-ignis python38Packages.qiskit-terra python38Packages.retworkx python38Packages.yfinance

the failure:

=================================== FAILURES ===================================
__________________________ TestOptimizers.test_p_bfgs __________________________

self = <test.aqua.test_optimizers.TestOptimizers testMethod=test_p_bfgs>

    def test_p_bfgs(self):
        """ parallel l_bfgs_b test """
        optimizer = P_BFGS(maxfun=1000)
        res = self._optimize(optimizer)
>       self.assertLessEqual(res[2], 10000)
E       AssertionError: 44250 not less than or equal to 10000

test/aqua/test_optimizers.py:69: AssertionError

@drewrisinger
Copy link
Contributor Author

drewrisinger commented Aug 24, 2020

the failure:

=================================== FAILURES ===================================
__________________________ TestOptimizers.test_p_bfgs __________________________

self = <test.aqua.test_optimizers.TestOptimizers testMethod=test_p_bfgs>

    def test_p_bfgs(self):
        """ parallel l_bfgs_b test """
        optimizer = P_BFGS(maxfun=1000)
        res = self._optimize(optimizer)
>       self.assertLessEqual(res[2], 10000)
E       AssertionError: 44250 not less than or equal to 10000

test/aqua/test_optimizers.py:69: AssertionError

@jonringer this is probably another massively-parallel CPU issue... the test runs an optimizer that distributes across the cores (https://github.com/Qiskit/qiskit-aqua/blob/72a6fb3b40accfe18b77bfb8c811aa94a7afa443/qiskit/aqua/components/optimizers/p_bfgs.py#L90), which each run an optimization and the number of function evalutions are summed across the processes and assumed to be < 10000 in the test.

I'll open an upstream issue, but in the meantime I feel comfortable disabling this test to get this PR to pass since I've not had this issue locally or on the GitHub Actions build of my NUR repo.

EDIT: upstream issue. qiskit-community/qiskit-aqua#1214

@jonringer
Copy link
Contributor

Steps to reproduce the problem

    Get a Threadripper 3990X (or equivalent many-core CPU), running Linux

lol, yes, $4k cpu :)

@drewrisinger
Copy link
Contributor Author

Steps to reproduce the problem

    Get a Threadripper 3990X (or equivalent many-core CPU), running Linux

lol, yes, $4k cpu :)

That is the CPU you tested it against, right?
And this package is distributed by IBM, I'm sure they have a few high-core-count systems like Summit that they could test this on if they really wanted :D

@jonringer
Copy link
Contributor

jonringer commented Aug 24, 2020

That is the CPU you tested it against, right?

yes

I'm sure they have a few high-core-count systems like Summit that they could test this on if they really wanted :D

right, or AMD's rome 7742 also has 64/128 https://www.newegg.com/amd-epyc-7742-socket-sp3/p/N82E16819113581

@drewrisinger
Copy link
Contributor Author

@jonringer pushed the patch upstream made. Hoping python3Packages.qiskit-aqua will build cleanly for you now.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff LGTM

https://github.com/NixOS/nixpkgs/pull/95713
26 packages built:
muparserx python27Packages.multitasking python27Packages.pylatexenc python27Packages.yfinance python37Packages.multitasking python37Packages.pylatexenc python37Packages.qasm2image python37Packages.qiskit python37Packages.qiskit-aer python37Packages.qiskit-aqua python37Packages.qiskit-ibmq-provider python37Packages.qiskit-ignis python37Packages.qiskit-terra python37Packages.retworkx python37Packages.yfinance python38Packages.multitasking python38Packages.pylatexenc python38Packages.qasm2image python38Packages.qiskit python38Packages.qiskit-aer python38Packages.qiskit-aqua python38Packages.qiskit-ibmq-provider python38Packages.qiskit-ignis python38Packages.qiskit-terra python38Packages.retworkx python38Packages.yfinance

cc @FRidh does the rust -> python retworkx changes look good to you?

@jonringer
Copy link
Contributor

@jonringer pushed the patch upstream made. Hoping python3Packages.qiskit-aqua will build cleanly for you now.

I think i mentioned it somewhere else, but i had to drop the NIX_BUILD_CORES to 32 due to other packages having timing issues (bashCompeletion would fail in tests, some meson builds would try to link against objects that don't exist, etc)

@drewrisinger
Copy link
Contributor Author

cc @FRidh does the rust -> python retworkx changes look good to you?

I based it on the @FRidh approved #91342 python3Packages.tokenizers.

@jonringer jonringer merged commit 4dee731 into NixOS:master Aug 25, 2020
@drewrisinger drewrisinger deleted the dr-pr-python-qiskit-bump branch August 26, 2020 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants