Skip to content

Add CI integration for Spark-X2.5 models - #23525

Open
dongjiang1989 wants to merge 1 commit into
pytorch:mainfrom
XHToken:support-spark2.5-ci
Open

dongjiang1989 wants to merge 1 commit into
pytorch:mainfrom
XHToken:support-spark2.5-ci

Conversation

@dongjiang1989

@dongjiang1989 dongjiang1989 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds CI integration for Spark-X2.5 models (1.7B and 4B variants) to the ExecuTorch test infrastructure.

Changes:

  • Added spark_x2_5_1_7b and spark_x2_5_4b model support to .ci/scripts/test_torchao_huggingface_checkpoints.sh
  • Added both models to the CI test matrix in .github/workflows/trunk.yml
  • Configured XNNPACK (x86_64) and TorchAO (ARM64) backend testing for both variants

The Spark-X2.5 model infrastructure (configs, weight conversion, documentation) already exists in the codebase. This PR completes the integration by adding automated CI testing.

Model specifications:

  • Spark-X2.5-1.7B: 28 layers, hybrid attention architecture (3 sliding + 1 full attention)
  • Spark-X2.5-4B: 36 layers, hybrid attention architecture
  • Both support 8da4w quantization and extended context (up to 1M tokens)

Hugging Face models:

  • XHToken/Spark-X2.5-1.7B
  • XHToken/Spark-X2.5-4B

Test plan

The changes add CI test coverage for both Spark-X2.5 model variants:

  1. Automated CI tests (via GitHub Actions):

    • Both models will be tested on x86_64 with XNNPACK backend
    • Both models will be tested on ARM64 with TorchAO backend
    • Tests verify model export, weight conversion, and basic inference
  2. Manual testing (to verify locally):

    # Test Spark-X2.5-1.7B
    bash .ci/scripts/test_torchao_huggingface_checkpoints.sh spark_x2_5_1_7b --test_with_runner
    
    # Test Spark-X2.5-4B
    bash .ci/scripts/test_torchao_huggingface_checkpoints.sh spark_x2_5_4b --test_with_runner
  3. Unit tests (already present):

    pytest examples/models/spark_x2_5/test_spark_x2_5.py -v

The CI script validates:

  • Model download from Hugging Face
  • Weight conversion to Meta format
  • Model export with 8da4w quantization
  • File size bounds (2GB for 1.7B, 5GB for 4B)
  • Inference via llama_main runner

cc @larryliu0820 @mergennachin @cccclai @helunwencser @jackzhxng @digantdesai @nil-is-all

@pytorch-bot

pytorch-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23525

Note: Links to docs will display an error until the docs builds have been completed.

⚠️ 24 Awaiting Approval

As of commit 04bf8e9 with merge base f2575be (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@executorch-triage executorch-triage Bot added the community: contribution PRs coming from community (excluding hardware partners) label Oct 7, 2026
@nil-is-all nil-is-all added the module: llm Issues related to LLM examples and apps, and to the extensions/llm/ code label Oct 7, 2026
@nil-is-all

Copy link
Copy Markdown
Contributor

@dongjiang1989 could you fix the CI failures? Do ping when ready for review.

@nil-is-all nil-is-all added the need-user-input The issue needs more information from the reporter before moving forward label Oct 7, 2026
@nil-is-all

Copy link
Copy Markdown
Contributor

@dongjiang1989 this revert would have resolved the failing CI. Could you try with this and ping to trigger CI workflows?

@dongjiang1989

Copy link
Copy Markdown
Contributor Author

@dongjiang1989 could you fix the CI failures? Do ping when ready for review.

Thx @nil-is-all rebase done.
Please recheck it, thanks

@nil-is-all nil-is-all removed the need-user-input The issue needs more information from the reporter before moving forward label Oct 8, 2026
@dongjiang1989

dongjiang1989 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Hey @nil-is-all

CI is failing because /mnt/hf_cache on the runners is read-only. The existing models (qwen3, phi_4_mini, lfm2_5) are pre-cached there, but XHToken/Spark-X2.5-1.7B and XHToken/Spark-X2.5-4B are not, so hf download fails with:

OSError: [Errno 30] Read-only file system: /mnt/hf_cache/hub/models--XHToken--Spark-X2.5-*

Please add pre-cache the two Spark-X2.5 models in /mnt/hf_cache?

@nil-is-all

Copy link
Copy Markdown
Contributor

Hey @nil-is-all

CI is failing because /mnt/hf_cache on the runners is read-only. The existing models (qwen3, phi_4_mini, lfm2_5) are pre-cached there, but XHToken/Spark-X2.5-1.7B and XHToken/Spark-X2.5-4B are not, so hf download fails with:

OSError: [Errno 30] Read-only file system: /mnt/hf_cache/hub/models--XHToken--Spark-X2.5-*

Please add pre-cache the two Spark-X2.5 models in /mnt/hf_cache?

@dongjiang1989 I'd suggest making the script not depend on the shared cache being pre-populated.
The script only needs /mnt/hf_cache to be readable. The failure is hf download trying to create models--XHToken--Spark-X2.5-* in a read-only mount. If you point it at a writable workspace dir for these models, the download lands somewhere writable, But I'll run CI to check if it still flags it.

@dongjiang1989

Copy link
Copy Markdown
Contributor Author

@dongjiang1989 I'd suggest making the script not depend on the shared cache being pre-populated.

Thanks @nil-is-all Change model download dir to custom dir.
Please recheck it, 🤭

This commit adds CI test support for Spark-X2.5-1.7B and Spark-X2.5-4B
models to the ExecuTorch test infrastructure.

Changes:
- Added spark_x2_5_1_7b and spark_x2_5_4b to test_torchao_huggingface_checkpoints.sh
- Added both models to CI test matrix in trunk.yml
- Configured XNNPACK (x86_64) and TorchAO (ARM64) backend testing
- Use --local-dir for hf download to avoid read-only /mnt/hf_cache issues

The Spark-X2.5 model infrastructure already exists in the codebase.
This commit completes the integration by adding automated CI testing.

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

This branch has not been deployed

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. community: contribution PRs coming from community (excluding hardware partners) module: llm Issues related to LLM examples and apps, and to the extensions/llm/ code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants