Skip to content

Add MLX_CONV_WINOGRAD switch to disable winograd for conv2d - #4639

Merged
zcbenz merged 1 commit into
ml-explore:mainfrom
ishaanzee:conv-winograd-switch
Oct 8, 2026
Merged

zcbenz merged 1 commit into
ml-explore:mainfrom
ishaanzee:conv-winograd-switch

Conversation

@ishaanzee

Copy link
Copy Markdown
Contributor
  • ☑️ I understand it is strictly prohibited to use AI to write PR description
  • AI usage disclosure: ai helped with the test, docs text and repro script

@zcbenz in #4595:

Sounds good to me to have a MLX_CONV_WINOGRAD switch.

MLX_CONV_WINOGRAD=0 turns off winograd for conv2d. It's read per call, like the other MLX_CONV_WINOGRAD_* vars.

Winograd selection depends on N x H x W, so results change with batch size. Error goes from ~2e-5 to 2.5e-4 from batch 3 up. (can see here #4595 (comment))

  • The one condition is in conv.cpp
  • docs in environment_variables.rst and precision.rst
  • test in python/tests/test_conv.py

the new test fails w/o the change and passes with it, and the full suite passes on my m3 pro (939 passed)

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.

2 participants