Skip to content

Conversation

@dsfaccini
Copy link
Contributor

Summary

  • Adds AVX2 CPU support detection before running llama_cpp tests
  • Gracefully skips tests on machines without AVX2 instead of crashing with Fatal Python error: Illegal instruction
  • Fixes flaky CI failures on GitHub Actions runners that lack AVX2 support

Background

The llama_cpp tests have been regularly failing in CI with:

Fatal Python error: Illegal instruction

This happens because llama_cpp uses AVX2 CPU instructions that aren't available on all GitHub Actions runners. Since runners are heterogeneous, the tests are flaky - they pass on some runners and crash on others.

Example failure: https://github.com/pydantic/pydantic-ai/actions/runs/19935894476

Solution

Add a check for AVX2 support on Linux by reading /proc/cpuinfo. If AVX2 is not available, the tests are skipped gracefully rather than crashing.

Test plan

  • Pre-commit checks pass
  • CI should now skip llama_cpp tests on runners without AVX2 instead of crashing

🤖 Generated with Claude Code

@dsfaccini
Copy link
Contributor Author

obviously isn't fixing the error, this outlines test is too flaky on CI, some runners obviously miss an instruction that test_outlines triggers but I can't pinpoint which

The llama_cpp tests have been flaky in CI because they crash with
'Fatal Python error: Illegal instruction' on GitHub Actions runners
that don't support AVX2 CPU instructions.

This adds an AVX2 detection check on Linux via /proc/cpuinfo to
gracefully skip the tests on incompatible machines instead of crashing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dsfaccini dsfaccini force-pushed the fix-llama-cpp-avx2-check branch from 52b9283 to d73000d Compare December 4, 2025 20:08
@dsfaccini
Copy link
Contributor Author

@DouweM smart code fixes didn't work. To disable it for now you'd need to change the ci.yml

just changing the var:

      # RUN_LLAMA_CPP_TESTS: ${{ matrix.python-version == '3.13' && matrix.install.name == 'all-extras' }}
      RUN_LLAMA_CPP_TESTS: false

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.

1 participant