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

fix tensorflow rocm resolution by installing it from .whl file #609

Merged

Conversation

atheo89
Copy link
Member

@atheo89 atheo89 commented Jul 8, 2024

Related to: https://issues.redhat.com/browse/RHOAIENG-9596

Description

We have the following error in ocp-ci and locally, when we try to fetch the tensorflow python package from repo url. :

Looking in indexes: https://repo.radeon.com/rocm/manylinux/rocm-rel-6.1/
ERROR: Could not find a version that satisfies the requirement tensorflow==2.15.1 (from versions: none)
ERROR: No matching distribution found for tensorflow==2.15.1
Failed to install 'tensorflow', will try in next installation round...

Most probably, the issue seems to stem from the fact that the custom source URL we are using for tensorflow_rocm does not have the necessary metadata that pipenv uses to resolve and lock dependencies. When pipenv tries to find the specified package in the custom index, it fails because it doesn't find any matching version metadata.

This fix specify the direct URL to the wheel file in the Pipfile instead of using the custom index.

How has been tested

Run the following cmd to spin up the image:
podman run --rm -it -p8888:8888 ghcr.io/atheo89/notebooks/workbench-images:amd-jupyter-tensorflow-c9s-python-3.9-resolve-tensorflow-rocm_3f5325cf541e01dc0b747432bd7ea99dd6614ec6

Create a new notebook and run: pip show tensorflow_rocm
You should see the following:

Name: tensorflow-rocm
Version: 2.15.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: [email protected]
License: Apache 2.0
Location: /opt/app-root/lib/python3.9/site-packages
Requires: absl-py, astunparse, flatbuffers, gast, google-pasta, grpcio, h5py, keras, libclang, ml-dtypes, numpy, opt-einsum, packaging, protobuf, setuptools, six, tensorboard, tensorflow-estimator, tensorflow-io-gcs-filesystem, termcolor, typing-extensions, wrapt
Required-by: 
Note: you may need to restart the kernel to use updated packages.

Run a test case, where it provided here: https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/3rd-party/tensorflow-install.html#running-a-basic-tensorflow-example it should be run successfully

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@jiridanek
Copy link
Member

/lgtm it fixed gha!

Copy link
Member

@harshad16 harshad16 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

great catch 💯

Copy link
Contributor

openshift-ci bot commented Jul 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: harshad16

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

@openshift-ci openshift-ci bot added the approved label Jul 8, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 74e032e into opendatahub-io:main Jul 8, 2024
6 checks passed
@atheo89 atheo89 deleted the resolve-tensorflow-rocm branch October 23, 2024 08:04
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.

3 participants