Skip to content

[ET Device Support] CUDA-native Qwen 3.5 MoE inference with device tensor pipeline#18788

Open
Gasoonjia wants to merge 2 commits intogh/gasoonjia/164/basefrom
gh/gasoonjia/164/head
Open

[ET Device Support] CUDA-native Qwen 3.5 MoE inference with device tensor pipeline#18788
Gasoonjia wants to merge 2 commits intogh/gasoonjia/164/basefrom
gh/gasoonjia/164/head

Conversation

@Gasoonjia
Copy link
Copy Markdown
Contributor

@Gasoonjia Gasoonjia commented Apr 9, 2026

Stack from ghstack (oldest at bottom):

Integrate the ET device tensor pipeline into the Qwen 3.5 MoE model to
eliminate unnecessary H2D/D2H copies during inference.

  • Export: Multi-method export (forward + sample) with device memory
    planning enabled and method-level H2D/D2H skipping.
  • Runner: Custom CUDA-native inference loop that keeps logits on GPU
    between forward and sample, reuses CUDA tensors across iterations,
    and only copies the 8-byte token ID back to CPU for EOS checking.

Differential Revision: D100133933

…nsor pipeline

Integrate the ET device tensor pipeline into the Qwen 3.5 MoE model to
eliminate unnecessary H2D/D2H copies during inference.

- Export: Multi-method export (`forward` + `sample`) with device memory
  planning enabled and method-level H2D/D2H skipping.
- Runner: Custom CUDA-native inference loop that keeps logits on GPU
  between forward and sample, reuses CUDA tensors across iterations,
  and only copies the 8-byte token ID back to CPU for EOS checking.

Differential Revision: [D100133933](https://our.internmc.facebook.com/intern/diff/D100133933/)

[ghstack-poisoned]
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Apr 9, 2026

🔗 Helpful Links

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

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

❌ 85 New Failures, 1 Cancelled Job

As of commit 5863ffa with merge base b5ae0b9 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

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 Apr 9, 2026
Gasoonjia added a commit that referenced this pull request Apr 9, 2026
…nsor pipeline

Integrate the ET device tensor pipeline into the Qwen 3.5 MoE model to
eliminate unnecessary H2D/D2H copies during inference.

- Export: Multi-method export (`forward` + `sample`) with device memory
  planning enabled and method-level H2D/D2H skipping.
- Runner: Custom CUDA-native inference loop that keeps logits on GPU
  between forward and sample, reuses CUDA tensors across iterations,
  and only copies the 8-byte token ID back to CPU for EOS checking.

Differential Revision: [D100133933](https://our.internmc.facebook.com/intern/diff/D100133933/)

ghstack-source-id: 364764771
Pull Request resolved: #18788
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

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.

…h device tensor pipeline"

Integrate the ET device tensor pipeline into the Qwen 3.5 MoE model to
eliminate unnecessary H2D/D2H copies during inference.

- Export: Multi-method export (`forward` + `sample`) with device memory
  planning enabled and method-level H2D/D2H skipping.
- Runner: Custom CUDA-native inference loop that keeps logits on GPU
  between forward and sample, reuses CUDA tensors across iterations,
  and only copies the 8-byte token ID back to CPU for EOS checking.

Differential Revision: [D100133933](https://our.internmc.facebook.com/intern/diff/D100133933/)

[ghstack-poisoned]
Gasoonjia added a commit that referenced this pull request Apr 9, 2026
…nsor pipeline

Pull Request resolved: #18788

Integrate the ET device tensor pipeline into the Qwen 3.5 MoE model to
eliminate unnecessary H2D/D2H copies during inference.

- Export: Multi-method export (`forward` + `sample`) with device memory
  planning enabled and method-level H2D/D2H skipping.
- Runner: Custom CUDA-native inference loop that keeps logits on GPU
  between forward and sample, reuses CUDA tensors across iterations,
  and only copies the 8-byte token ID back to CPU for EOS checking.
ghstack-source-id: 364908062
@exported-using-ghexport

Differential Revision: [D100133933](https://our.internmc.facebook.com/intern/diff/D100133933/)
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. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant