Skip to content

chore(deps): relax numpy pin to >=1.26.4 for bfcl-eval compatibility#345

Closed
Palanivelg wants to merge 1 commit into
mlcommons:mainfrom
Palanivelg:chore/relax-numpy-pin
Closed

chore(deps): relax numpy pin to >=1.26.4 for bfcl-eval compatibility#345
Palanivelg wants to merge 1 commit into
mlcommons:mainfrom
Palanivelg:chore/relax-numpy-pin

Conversation

@Palanivelg

Copy link
Copy Markdown
Contributor

bfcl-eval (used in the upcoming BFCL v4 accuracy integration) hard-pins numpy==1.26.4, which is mutually exclusive with our existing top-level numpy==2.4.4 pin and causes pip's resolver to fail when installing the [bfcl] extra.

Relax the top-level pin to a lower bound (>=1.26.4) so pip can satisfy both constraints. Our code paths work with numpy 1.x and 2.x; the only binding constraint comes from bfcl-eval. When [bfcl] is not installed, pip will still resolve the latest numpy.

Note: this is a narrow exception to the AGENTS.md "pin exact versions" rule, driven by an external library's hard pin. If we want to enforce a single resolved version everywhere, the alternative is to pin numpy==1.26.4 (matching bfcl-eval) at the top level.

What does this PR do?

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor/cleanup

Related issues

Testing

  • Tests added/updated
  • All tests pass locally
  • Manual testing completed

Checklist

  • Code follows project style
  • Pre-commit hooks pass
  • Documentation updated (if needed)

@Palanivelg Palanivelg requested a review from a team June 8, 2026 17:03
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request relaxes the dependency requirement for numpy in pyproject.toml from ==2.4.4 to >=1.26.4. The reviewer recommends keeping a strict pin of ==1.26.4 instead of a relaxed constraint to prevent potential API incompatibilities and reproducibility issues caused by major breaking changes in numpy 2.0.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread pyproject.toml
# Required by transformers' apply_chat_template
"jinja2==3.1.6",
"numpy==2.4.4",
"numpy>=1.26.4",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Relaxing the numpy pin to >=1.26.4 allows pip to resolve to either numpy 1.x (when [bfcl] is installed) or numpy 2.x (when it is not). Because numpy 2.0 introduced significant breaking changes, running different major versions of numpy across environments can lead to subtle bugs, API incompatibilities, or non-reproducible benchmark results. To maintain strict environment reproducibility and adhere to the repository's exact-pinning policy, consider pinning numpy to 1.26.4 globally instead.

Suggested change
"numpy>=1.26.4",
"numpy==1.26.4",

bfcl-eval (used in the upcoming BFCL v4 accuracy integration) hard-pins
numpy==1.26.4, which is mutually exclusive with our existing top-level
numpy==2.4.4 pin and causes pip's resolver to fail when installing the
[bfcl] extra.

Relax the top-level pin to a lower bound (>=1.26.4) so pip can satisfy
both constraints. Our code paths work with numpy 1.x and 2.x; the only
binding constraint comes from bfcl-eval. When [bfcl] is not installed,
pip will still resolve the latest numpy.

Note: this is a narrow exception to the AGENTS.md "pin exact versions"
rule, driven by an external library's hard pin. If we want to enforce
a single resolved version everywhere, the alternative is to pin
numpy==1.26.4 (matching bfcl-eval) at the top level.
@Palanivelg

Copy link
Copy Markdown
Contributor Author

Superseded by #346, which now includes this numpy relaxation (numpy>=1.26.4) directly so the BFCL-v4 integration is self-contained and passes CI on its own. Closing as redundant.

@Palanivelg Palanivelg closed this Jun 8, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant