You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "mshr-h (via GitHub)" <gi...@apache.org> on 2026/02/23 10:21:53 UTC

[PR] [WIP][Refactor][CI] Modernize Python dependency management with uv [tvm]

mshr-h opened a new pull request, #18812:
URL: https://github.com/apache/tvm/pull/18812

   wip


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [WIP][Refactor][CI] Modernize Python dependency management with uv [tvm]

Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #18812:
URL: https://github.com/apache/tvm/pull/18812#discussion_r2840063738


##########
docs/README.md:
##########
@@ -48,9 +48,9 @@ This folder contains the source of TVM's documentation, hosted at https://tvm.ap
    ```bash
    # Pillow on Ubuntu may require libjpeg-dev from apt
    ./docker/bash.sh ci_gpu -c \
-       'python3 -m pip install --quiet tlcpack-sphinx-addon==0.2.1 && python3 -m pip freeze' > frozen-requirements.txt
+         'uv pip install --quiet tlcpack-sphinx-addon==0.2.1 && uv pip freeze' > frozen-requirements.txt
 
-   pip install -r frozen-requirements.txt
+      uv pip install -r frozen-requirements.txt

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The indentation for this command appears to be inconsistent with the rest of the code block. For better readability, it should be aligned with the `./docker/bash.sh` command on line 50.
   
   ```suggestion
      uv pip install -r frozen-requirements.txt
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [WIP][Refactor][CI] Modernize Python dependency management with uv [tvm]

Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on PR #18812:
URL: https://github.com/apache/tvm/pull/18812#issuecomment-3943873975

   ## Summary of Changes
   
   Hello @mshr-h, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
   
   This pull request significantly refactors the project's Python dependency management by adopting `uv` as the primary tool for package installation and locking. This change impacts various aspects of the development workflow, including Docker image builds, CI/CD pipelines, and local development setup, aiming for improved performance and reliability in handling Python environments. The shift to `uv` simplifies the dependency resolution process and standardizes package management practices across the repository.
   
   ### Highlights
   
   * **Python Dependency Management Modernization**: Migrated Python package installation and dependency locking from `pip` and `poetry` to `uv` across Dockerfiles, installation scripts, and CI workflows.
   * **CI/CD Streamlining**: Removed the dedicated GitHub Action for Conda setup, simplifying the CI environment configuration.
   * **Docker Image Optimization**: Introduced global disabling of `uv` cache in Dockerfiles and updated Python installation steps to leverage `uv` for faster and more consistent builds.
   * **Documentation Updates**: Modified documentation examples in `README.md`, `pull_request.rst`, and `from_source.rst` to reflect the new `uv` usage.
   * **Test Suite Adjustment**: Added a specific `pytest.xfail` condition for certain parameters in `test_frontend_onnx.py` to handle a known runtime error.
   
   🧠 **New Feature in Public Preview:** You can now enable **Memory** to help **Gemini Code Assist** learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. **Click [here](https://codeassist.google/code-review/login) to enable Memory in your admin console.**
   
   <details>
   <summary><b>Changelog</b></summary>
   
   * **.github/actions/setup/action.yml**
       * Removed the entire GitHub Actions workflow for Conda setup.
   * **docker/Dockerfile.ci_arm**
       * Added an environment variable to globally disable `uv` cache.
   * **docker/Dockerfile.ci_cpu**
       * Added an environment variable to globally disable `uv` cache.
   * **docker/Dockerfile.ci_gpu**
       * Added an environment variable to globally disable `uv` cache.
       * Removed the command to globally disable `pip` cache.
   * **docker/Dockerfile.ci_lint**
       * Added an environment variable to globally disable `uv` cache.
       * Replaced `pip3 install` with `uv pip install` for linting tool dependencies.
   * **docker/install/ubuntu_install_coreml.sh**
       * Replaced `pip3 install` with `uv pip install` for coremltools.
   * **docker/install/ubuntu_install_cuda_python.sh**
       * Replaced `pip3 install` with `uv pip install` for cuda-python.
   * **docker/install/ubuntu_install_dgl.sh**
       * Replaced `pip3 install` with `uv pip install` for dgl.
   * **docker/install/ubuntu_install_gluoncv.sh**
       * Replaced `pip3 install` with `uv pip install` for gluoncv.
   * **docker/install/ubuntu_install_jax.sh**
       * Replaced `pip3 install` with `uv pip install` for jax and flax installations.
   * **docker/install/ubuntu_install_nnef.sh**
       * Replaced `pip3 install` with `uv pip install` for nnef.
   * **docker/install/ubuntu_install_onnx.sh**
       * Replaced `pip3 install` with `uv pip install` for onnx, onnxruntime, onnxoptimizer, torch, and torchvision.
   * **docker/install/ubuntu_install_python.sh**
       * Removed `pip` update and configuration steps.
       * Installed `uv` into the build virtual environment.
       * Configured `UV_NO_CACHE=1` for Python package installations.
       * Replaced `pip install` with `uv pip install` for base packages.
       * Modified the `pip` and `pip3` wrapper scripts to route commands through `uv`.
   * **docker/install/ubuntu_install_python_package.sh**
       * Replaced `pip3 install` with `uv pip install` for common Python packages.
   * **docker/install/ubuntu_install_redis.sh**
       * Replaced `pip3 install` with `uv pip install` for xgboost.
   * **docker/install/ubuntu_install_sphinx.sh**
       * Replaced `pip3 install` with `uv pip install` for Sphinx-related packages.
   * **docker/install/ubuntu_install_tensorflow.sh**
       * Replaced `pip3 install` with `uv pip install` for tensorflow.
   * **docker/install/ubuntu_install_tensorflow_aarch64.sh**
       * Replaced `pip3 install` with `uv pip install` for numpy and tensorflow.
   * **docker/install/ubuntu_install_tflite.sh**
       * Replaced `pip3 install` with `uv pip install` for flatbuffers.
   * **docker/python/bootstrap/generate.sh**
       * Refactored the dependency locking mechanism to use `uv pip compile` instead of `poetry`.
       * Updated the `requirements.in` file content to include `uv` and remove `poetry`.
   * **docker/python/bootstrap/lockfiles/constraints-3.10.txt**
       * Updated the generated constraints file to reflect `uv` as the locking tool, significantly reducing its size and changing its content to include `uv`.
   * **docker/python/bootstrap/lockfiles/requirements-3.10.txt**
       * Removed `poetry` and added `uv` to the list of required packages.
   * **docs/README.md**
       * Updated documentation examples to use `uv pip install` instead of `python3 -m pip install` or `pip install`.
   * **docs/contribute/pull_request.rst**
       * Updated documentation example to use `uv pip install` for pytest and Cython installation.
   * **docs/install/from_source.rst**
       * Updated documentation examples to use `uv pip install` for installing tvm-ffi and other Python dependencies.
   * **python/.gitignore**
       * Added new entries to ignore `apache_tvm_ffi-*`, `tvm_ffi/*`, `typing_extensions.py`, `typing_extensions-*.dist-info`, and `bin/`.
   * **tests/python/relax/test_frontend_onnx.py**
       * Added a `pytest.xfail` condition for `test_unique` when `num_outputs` is 3 or 4 and `axis` is None, addressing a known runtime error.
   * **tests/scripts/ci.py**
       * Updated documentation requirements installation to use `uv pip install`.
   * **tests/scripts/task_python_docs.sh**
       * Updated tvm-ffi setup to use `uv pip`.
   * **tests/scripts/task_python_hexagon.sh**
       * Updated tvm-ffi setup to use `uv pip`.
   * **tests/scripts/task_python_integration.sh**
       * Updated tvm-ffi setup to use `uv pip`.
   * **tests/scripts/task_python_nightly.sh**
       * Updated tvm-ffi setup to use `uv pip`.
   * **tests/scripts/task_python_unittest.sh**
       * Updated tvm-ffi setup to use `uv pip`.
   * **tests/scripts/task_web_wasm.sh**
       * Updated tvm-ffi setup to use `uv pip`.
   </details>
   
   <details>
   <summary><b>Ignored Files</b></summary>
   
   *   **Ignored by pattern:** `.github/workflows/**` (1)
       *   .github/workflows/main.yml
   </details>
   
   <details>
   <summary><b>Activity</b></summary>
   
   * The pull request is marked as 'Work In Progress' (WIP) by the author, mshr-h.
   * The pull request description is brief, indicating that the changes are still under active development.
   </details>
   
   <details>
   <summary><b>Using Gemini Code Assist</b></summary>
   <br>
   
   The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips.
   
   <b>Invoking Gemini</b>
   
   You can request assistance from Gemini at any point by creating a comment using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands on the current page.
   
   Feature | Command | Description
   --- | --- | ---
   Code Review | `/gemini review` | Performs a code review for the current pull request in its current state.
   Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state.
   Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments.
   Help | `/gemini help` | Displays a list of available commands.
   
   <b>Customization</b>
   
   To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github).
   
   <b>Limitations & Feedback</b>
   
   Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up [here](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG).
   
   <b>You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the [Gemini Code Assist IDE Extension](https://cloud.google.com/products/gemini/code-assist).</b>
   </details>
   
   
   [^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [REFACTOR][CI] Modernize Python dependency management with uv [tvm]

Posted by "yongwww (via GitHub)" <gi...@apache.org>.
yongwww merged PR #18812:
URL: https://github.com/apache/tvm/pull/18812


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [REFACTOR][CI] Modernize Python dependency management with uv [tvm]

Posted by "mshr-h (via GitHub)" <gi...@apache.org>.
mshr-h commented on code in PR #18812:
URL: https://github.com/apache/tvm/pull/18812#discussion_r2850610677


##########
docker/install/ubuntu_install_python_package.sh:
##########
@@ -21,25 +21,25 @@ set -u
 set -o pipefail
 
 # install libraries for python package on ubuntu
-pip3 install --upgrade \
-    "Pygments>=2.4.0" \
-    cloudpickle \
-    cython \
-    mypy \
+uv pip install --upgrade \
+    "Pygments~=2.19" \

Review Comment:
   I checked the versions with `pip index versions` in the current docker images and picked them one by one. Something like:
   - `python3 tests/scripts/ci.py cpu --interactive`, then
   - `for p in Pygments cloudpickle cython mypy numpy orderedset packaging Pillow psutil pytest pytest-profiling pytest-xdist pytest-rerunfailures requests scipy Jinja2 junitparser six tornado ml_dtypes; do echo "=== $p ==="; python3.10 -m pip index versions "$p"; done`
   
   Maybe we can just write a small script to automate this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [Refactor][Python][CI] Modernize Python dependency management with uv [tvm]

Posted by "mshr-h (via GitHub)" <gi...@apache.org>.
mshr-h commented on PR #18812:
URL: https://github.com/apache/tvm/pull/18812#issuecomment-3950889056

   cc @tqchen @yongwww 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [REFACTOR][CI] Modernize Python dependency management with uv [tvm]

Posted by "mshr-h (via GitHub)" <gi...@apache.org>.
mshr-h commented on code in PR #18812:
URL: https://github.com/apache/tvm/pull/18812#discussion_r2850601443


##########
docker/install/ubuntu_install_python_package.sh:
##########
@@ -21,25 +21,25 @@ set -u
 set -o pipefail
 
 # install libraries for python package on ubuntu
-pip3 install --upgrade \
-    "Pygments>=2.4.0" \
-    cloudpickle \
-    cython \
-    mypy \
+uv pip install --upgrade \
+    "Pygments~=2.19" \

Review Comment:
   I checked the versions with `pip index versions` in the current docker images and picked them one by one. Something like:
   - `python3 tests/scripts/ci.py cpu --interactive`, then
   - `for p in Pygments cloudpickle cython mypy numpy orderedset packaging Pillow psutil pytest pytest-profiling pytest-xdist pytest-rerunfailures requests scipy Jinja2 junitparser six tornado ml_dtypes; do echo "=== $p ==="; python3.10 -m pip index versions "$p"; done`
   
   Maybe we can just write a small script to automate this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [REFACTOR][CI] Modernize Python dependency management with uv [tvm]

Posted by "yongwww (via GitHub)" <gi...@apache.org>.
yongwww commented on code in PR #18812:
URL: https://github.com/apache/tvm/pull/18812#discussion_r2848359520


##########
docker/install/ubuntu_install_python_package.sh:
##########
@@ -21,25 +21,25 @@ set -u
 set -o pipefail
 
 # install libraries for python package on ubuntu
-pip3 install --upgrade \
-    "Pygments>=2.4.0" \
-    cloudpickle \
-    cython \
-    mypy \
+uv pip install --upgrade \
+    "Pygments~=2.19" \

Review Comment:
   I have a dumb question, how do we get the the deps pins (e.g., Pygments/cloudpickle/cython/mypy/pytest/requests/scipy/Jinja2/ml_dtypes, etc.) here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [REFACTOR][CI] Modernize Python dependency management with uv [tvm]

Posted by "mshr-h (via GitHub)" <gi...@apache.org>.
mshr-h commented on code in PR #18812:
URL: https://github.com/apache/tvm/pull/18812#discussion_r2850601443


##########
docker/install/ubuntu_install_python_package.sh:
##########
@@ -21,25 +21,25 @@ set -u
 set -o pipefail
 
 # install libraries for python package on ubuntu
-pip3 install --upgrade \
-    "Pygments>=2.4.0" \
-    cloudpickle \
-    cython \
-    mypy \
+uv pip install --upgrade \
+    "Pygments~=2.19" \

Review Comment:
   I checked the versions with `pip index versions` in the current docker images and picked them one by one. Something like:
   - `python3 tests/scripts/ci.py cpu --interactive`, then
   - `for p in Pygments cloudpickle cython mypy numpy orderedset packaging Pillow psutil pytest pytest-profiling pytest-xdist pytest-rerunfailures requests scipy Jinja2 junitparser six tornado ml_dtypes; do echo "=== $p ==="; python3.10 -m pip index versions "$p"; done`
   
   Maybe we can just write a small script to automate this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org