Skip to content

Conversation

@PaliC
Copy link
Collaborator

@PaliC PaliC commented Dec 23, 2025

This pull request transitions the project to use pyproject.toml and the uv tool for modern Python dependency and environment management, replacing the previous reliance on requirements.txt, pip, and setup.py. It updates documentation and scripts to reflect the new workflow, and removes the legacy setup.py file.

Testing:
Modal was tested by using uv run python scripts/generate_and_eval_single_sample_modal.py dataset_sr c=c=huggingface level=2 problem_id=40 server_type=google model_name=gemini/gemini-2.5-flash otherwise, functionality was tested by using the commands in the readme.

Update: modal and local evaluation still work with the new UV-based system. Modal exhibits a cache hit on the image with UV-based package management which is great for evaluation speed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This work-in-progress pull request migrates the project's dependency management from pip/setuptools to uv, a modern Python package manager. The changes eliminate traditional setup files in favor of uv's project management approach and update all Modal container image configurations to use uv for dependency installation.

  • Removes setup.py and requirements.txt files, transitioning to uv-based dependency management
  • Updates all Modal image configurations to use .uv_sync() instead of .pip_install_from_requirements()
  • Updates README documentation with uv installation instructions and command examples using uv run python

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
setup.py Completely removed as part of migration to uv-based project structure
requirements.txt Completely removed; dependencies now managed via pyproject.toml and uv.lock
scripts/run_and_check.py Updated Modal image to use uv_sync for dependency installation
scripts/generate_baseline_time_modal.py Updated Modal image to use uv_sync for dependency installation
scripts/generate_and_eval_single_sample_modal.py Updated Modal image to use uv_sync for dependency installation
scripts/eval_from_generations.py Updated Modal image to use uv_sync for dependency installation
README.md Updated setup instructions for uv, added bash syntax highlighting, and updated all command examples to use uv run python

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

README.md Outdated
Comment on lines 78 to 80
## 🔧 Set up
```
conda create --name kernel-bench python=3.10
conda activate kernel-bench
pip install -r requirements.txt
pip install -e .
```

Install [uv](https://docs.astral.sh/uv/getting-started/installation/) if you haven't already
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

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

The installation instructions are incomplete. After installing uv, users need guidance on how to actually set up the project dependencies. The instructions should mention running a command like 'uv sync' or 'uv install' to install the project dependencies defined in the pyproject.toml file before they can run any scripts.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree let's have a clear pyproject.toml that clarify what needs to be installed (as a single source of truth)

@PaliC PaliC changed the title [WIP] Uv support Uv support Dec 24, 2025
@simonguozirui simonguozirui changed the title Uv support Migrating to UV for Dependency Dec 27, 2025
@simonguozirui
Copy link
Collaborator

Thanks to @PaliC and @alexzhang13 for advocating the benefits of uv. We’ve migrated KernelBench to uv-based dependency management, which simplifies environment setup and improves reproducibility.

This is particularly helpful since KernelBench is often used as a sub-dependency within larger projects; uv makes it easier to manage nested dependency resolution and versioning in those workflows.

The migration has been validated locally and on Modal. For compatibility, the previous setup using conda and requirements.txt is still supported as a fallback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants