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

Pin the NumPy version with v1.23.5 in some images #2070

Merged
merged 1 commit into from
Dec 24, 2022

Conversation

tenzen-y
Copy link
Member

@tenzen-y tenzen-y commented Dec 23, 2022

Signed-off-by: Yuki Iwai yuki.iwai.tz@gmail.com

What this PR does / why we need it:
I pinned the NumPy version with v1.23.5 in the mxnet-mnist image and the skopt suggestion image to avoid the following errors:

  • mxnet-mnist
I1223 17:32:59.235460      19 main.go:396] Trial Name: grid-ssmbrpvl
I1223 17:33:07.242688      19 main.go:139] /usr/local/lib/python3.9/site-packages/mxnet/numpy/utils.py:37: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
I1223 17:33:07.242711      19 main.go:139]   bool = onp.bool
I1223 17:33:07.244035      19 main.go:139] Traceback (most recent call last):
I1223 17:33:07.244094      19 main.go:139]   File "/opt/mxnet-mnist/mnist.py", line 24, in <module>
I1223 17:33:07.245554      19 main.go:139]     import mxnet as mx
I1223 17:33:07.245565      19 main.go:139]   File "/usr/local/lib/python3.9/site-packages/mxnet/__init__.py", line 33, in <module>
I1223 17:33:07.245949      19 main.go:139]     from . import contrib
I1223 17:33:07.245959      19 main.go:139]   File "/usr/local/lib/python3.9/site-packages/mxnet/contrib/__init__.py", line 30, in <module>
I1223 17:33:07.246245      19 main.go:139]     from . import text
I1223 17:33:07.246299      19 main.go:139]   File "/usr/local/lib/python3.9/site-packages/mxnet/contrib/text/__init__.py", line 23, in <module>
I1223 17:33:07.246526      19 main.go:139]     from . import embedding
I1223 17:33:07.246539      19 main.go:139]   File "/usr/local/lib/python3.9/site-packages/mxnet/contrib/text/embedding.py", line 36, in <module>
I1223 17:33:07.246899      19 main.go:139]     from ... import numpy as _mx_np
I1223 17:33:07.246914      19 main.go:139]   File "/usr/local/lib/python3.9/site-packages/mxnet/numpy/__init__.py", line 23, in <module>
I1223 17:33:07.247114      19 main.go:139]     from .multiarray import *  # pylint: disable=wildcard-import
I1223 17:33:07.247122      19 main.go:139]   File "/usr/local/lib/python3.9/site-packages/mxnet/numpy/multiarray.py", line 47, in <module>
I1223 17:33:07.247384      19 main.go:139]     from .utils import _get_np_op
I1223 17:33:07.247435      19 main.go:139]   File "/usr/local/lib/python3.9/site-packages/mxnet/numpy/utils.py", line 37, in <module>
I1223 17:33:07.247715      19 main.go:139]     bool = onp.bool
I1223 17:33:07.247731      19 main.go:139]   File "/usr/local/lib/python3.9/site-packages/numpy/__init__.py", line 284, in __getattr__
I1223 17:33:07.248506      19 main.go:139]     raise AttributeError("module {!r} has no attribute "
I1223 17:33:07.248685      19 main.go:139] AttributeError: module 'numpy' has no attribute 'bool'
  • skopt suggestion service
ERROR:grpc._server:Exception calling application: module 'numpy' has no attribute 'int'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/grpc/_server.py", line 443, in _call_behavior
    response_or_iterator = behavior(argument, context)
  File "/opt/katib/pkg/suggestion/v1beta1/skopt/service.py", line 55, in GetSuggestions
    new_trials = self.base_service.getSuggestions(trials, request.current_request_number)
  File "/opt/katib/pkg/suggestion/v1beta1/skopt/base_service.py", line 121, in getSuggestions
    skopt_suggested = self.skopt_optimizer.ask(n_points=current_request_number)
  File "/usr/local/lib/python3.9/site-packages/skopt/optimizer/optimizer.py", line 395, in ask
    x = opt.ask()
  File "/usr/local/lib/python3.9/site-packages/skopt/optimizer/optimizer.py", line 367, in ask
    return self._ask()
  File "/usr/local/lib/python3.9/site-packages/skopt/optimizer/optimizer.py", line 434, in _ask
    return self.space.rvs(random_state=self.rng)[0]
  File "/usr/local/lib/python3.9/site-packages/skopt/space/space.py", line 900, in rvs
    columns.append(dim.rvs(n_samples=n_samples, random_state=rng))
  File "/usr/local/lib/python3.9/site-packages/skopt/space/space.py", line 158, in rvs
    return self.inverse_transform(samples)
  File "/usr/local/lib/python3.9/site-packages/skopt/space/space.py", line 528, in inverse_transform
    inv_transform = super(Integer, self).inverse_transform(Xt)
  File "/usr/local/lib/python3.9/site-packages/skopt/space/space.py", line 168, in inverse_transform
    return self.transformer.inverse_transform(Xt)
  File "/usr/local/lib/python3.9/site-packages/skopt/space/transformers.py", line 309, in inverse_transform
    X = transformer.inverse_transform(X)
  File "/usr/local/lib/python3.9/site-packages/skopt/space/transformers.py", line 275, in inverse_transform
    return np.round(X_orig).astype(np.int)
  File "/usr/local/lib/python3.9/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'int'

/assign @andreyvelich @johnugeorge @gaocegege

Blocking: #2039 #2060 #2067

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Checklist:

  • Docs included if any changes are user facing

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tenzen-y

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tenzen-y tenzen-y changed the title Pin the numpy version with v1.23.5 in the mxnet-mnist image Pin the NumPy version with v1.23.5 in the mxnet-mnist image Dec 23, 2022
@johnugeorge
Copy link
Member

Thanks @tenzen-y for quick fix.

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Dec 23, 2022
@johnugeorge
Copy link
Member

We need to provide a clean fix in future when available

@tenzen-y
Copy link
Member Author

We need to provide a clean fix in future when available

Yes, I agree. We might be able to use the latest NumPy version once mxnet v2.0 or v1.9.2 is released.

@tenzen-y
Copy link
Member Author

Since the errors are caused by mxnet codes, not by our training codes.

@andreyvelich
Copy link
Member

Thank you for the prompt fix @tenzen-y !
/lgtm

@tenzen-y
Copy link
Member Author

It seems that E2E for bayesian-optimazation only failed...

2022/12/23 19:13:55 Deleting Experiment bayesian-optimization
2022/12/23 19:13:55 Wait Experiment finish failed: Experiment run timed out
NAME READY STATUS RESTARTS AGE
bayesian-optimization-bayesianoptimization-58d76b556b-pzzl5 1/1 Terminating 0 50m
katib-cert-generator-mx24r 0/1 Completed 0 53m
katib-controller-5c98d47df-vggdd 1/1 Running 0 53m
katib-db-manager-6d8679bd8c-d44hr 1/1 Running 0 53m
katib-mysql-6975d6c6c4-9bf6m 1/1 Running 0 53m

https://github.com/kubeflow/katib/actions/runs/3767418520/jobs/6404930467#step:4:12390

I could not reproduce it on my local :(

@tenzen-y
Copy link
Member Author

It looks like CI failure is caused by the skopt suggestion service image.

{"level":"error","ts":1671828340.3335319,"msg":"Reconciler error","controller":"suggestion-controller","object":{"name":"bayesian-optimization","namespace":"kubeflow"},"namespace":"kubeflow","name":"bayesian-optimization","reconcileID":"57312598-0447-4fba-95af-cb5d56b22f31","error":"rpc error: code = Unknown desc = Exception calling application: module 'numpy' has no attribute 'int'","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:326\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:273\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.13.0/pkg/internal/controller/controller.go:234"}

https://github.com/tenzen-y/katib/actions/runs/3768079424/jobs/6406216537#step:4:10644

@tenzen-y
Copy link
Member Author

ERROR:grpc._server:Exception calling application: module 'numpy' has no attribute 'int'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/grpc/_server.py", line 443, in _call_behavior
    response_or_iterator = behavior(argument, context)
  File "/opt/katib/pkg/suggestion/v1beta1/skopt/service.py", line 55, in GetSuggestions
    new_trials = self.base_service.getSuggestions(trials, request.current_request_number)
  File "/opt/katib/pkg/suggestion/v1beta1/skopt/base_service.py", line 121, in getSuggestions
    skopt_suggested = self.skopt_optimizer.ask(n_points=current_request_number)
  File "/usr/local/lib/python3.9/site-packages/skopt/optimizer/optimizer.py", line 395, in ask
    x = opt.ask()
  File "/usr/local/lib/python3.9/site-packages/skopt/optimizer/optimizer.py", line 367, in ask
    return self._ask()
  File "/usr/local/lib/python3.9/site-packages/skopt/optimizer/optimizer.py", line 434, in _ask
    return self.space.rvs(random_state=self.rng)[0]
  File "/usr/local/lib/python3.9/site-packages/skopt/space/space.py", line 900, in rvs
    columns.append(dim.rvs(n_samples=n_samples, random_state=rng))
  File "/usr/local/lib/python3.9/site-packages/skopt/space/space.py", line 158, in rvs
    return self.inverse_transform(samples)
  File "/usr/local/lib/python3.9/site-packages/skopt/space/space.py", line 528, in inverse_transform
    inv_transform = super(Integer, self).inverse_transform(Xt)
  File "/usr/local/lib/python3.9/site-packages/skopt/space/space.py", line 168, in inverse_transform
    return self.transformer.inverse_transform(Xt)
  File "/usr/local/lib/python3.9/site-packages/skopt/space/transformers.py", line 309, in inverse_transform
    X = transformer.inverse_transform(X)
  File "/usr/local/lib/python3.9/site-packages/skopt/space/transformers.py", line 275, in inverse_transform
    return np.round(X_orig).astype(np.int)
  File "/usr/local/lib/python3.9/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'int'

@tenzen-y tenzen-y changed the title Pin the NumPy version with v1.23.5 in the mxnet-mnist image Pin the NumPy version with v1.23.5 in the some images Dec 23, 2022
@tenzen-y tenzen-y changed the title Pin the NumPy version with v1.23.5 in the some images Pin the NumPy version with v1.23.5 in some images Dec 23, 2022
@tenzen-y
Copy link
Member Author

This skopt error is reported upstream, but the PR has not been merged...

scikit-optimize/scikit-optimize#1123

…uggestion service image

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
@johnugeorge
Copy link
Member

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Dec 24, 2022
@google-oss-prow google-oss-prow bot merged commit 1dd7251 into kubeflow:master Dec 24, 2022
@tenzen-y tenzen-y deleted the fix-mxnet-mnist-image branch December 24, 2022 04:21
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.

4 participants