Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI for XGrammar #214

Open
Ubospica opened this issue Feb 24, 2025 · 2 comments
Open

Add CI for XGrammar #214

Ubospica opened this issue Feb 24, 2025 · 2 comments

Comments

@Ubospica
Copy link
Collaborator

Ubospica commented Feb 24, 2025

XGrammar needs CI to ensure stability and help review community contributions. Guidelines for CI:

  1. Currently CI only needs to run on CPU (tests requiring GPU can be skipped, specifically the GPU kernel tests)
  2. Run linter (pre-commit hooks, ruff)
  3. Test on multiple platforms (Linux, MacOS, Windows) x (x64, ARM64)
  4. Test C++ and Python code (ctest and pytest)
  5. CI should be enforced to every commit on main branch, every PR, and can be manually triggered
  6. The model folder ~/.cache/huggingface should be shared between different runs
    Contribution is welcome!
@zbowling
Copy link
Contributor

That new build_and_release.yaml should run all the CPU tests (excluding HF_TOKEN needed tests, but it could do those too if an HF_TOKEN is added to GitHub secrets, but these tests take significantly longer to run). It doesn't run C++ tests at the moment, though, but I can send PR after #190 lands to do that :)

@Ubospica
Copy link
Collaborator Author

@zbowling Yes, the build_and_release workflow already runs Python tests. But to make is more clear I think the C++ and Python tests can be separated, so build_and_release is only responsible for testing whether the package can be built, while run_tests is responsible for running all the tests. The second workflow relies on the first for the built package and Github artifacts for file transfer.

Regarding the HF_TOKEN needed tests, I have added a secret secrets.HF_TOKEN that has access to all models in the tests. If the model can be cached, I think these tests should be executed faster.

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

No branches or pull requests

2 participants