Skip to content

refactor hip kernel -- remove torch from csrc#2545

Merged
valarLip merged 17 commits intomainfrom
refactor_hip_kernel
Apr 6, 2026
Merged

refactor hip kernel -- remove torch from csrc#2545
valarLip merged 17 commits intomainfrom
refactor_hip_kernel

Conversation

@amd-ruitang3
Copy link
Copy Markdown
Contributor

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@amd-ruitang3 amd-ruitang3 requested review from a team and Copilot March 31, 2026 02:29
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:triton-355 Run Triton tests on MI355 in addition to MI325
ci:sglang SGLang integration tests
ci:atom ATOM benchmark (DeepSeek-R1 + GPT-OSS)
ci:vllm vLLM benchmark
ci:all All of the above

Add labels via the sidebar or gh pr edit 2545 --add-label <label>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the C++/HIP side tensor handling to reduce reliance on Torch-side allocations by introducing a small RAII GPU tensor wrapper and adjusting header include ordering so the wrapper can use existing HIP error-handling macros.

Changes:

  • Added AiterTensor (move-only RAII) to allocate/free HIP device memory and provide empty/empty_like/zeros factory methods.
  • Updated header includes so aiter_tensor.h can use HIP_CALL, and aiter_hip_common.h pulls in tensor definitions after macros are defined.

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.

File Description
csrc/include/aiter_tensor.h Adds AiterTensor RAII wrapper and switches header dependencies to HIP common utilities.
csrc/include/aiter_hip_common.h Reorders inclusion of aiter_tensor.h to ensure HIP_CALL is available to AiterTensor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread csrc/include/aiter_tensor.h
Comment thread csrc/include/aiter_tensor.h
Comment thread csrc/include/aiter_tensor.h
Comment thread csrc/include/aiter_tensor.h
Comment thread csrc/include/aiter_tensor.h
@amd-ruitang3 amd-ruitang3 force-pushed the refactor_hip_kernel branch from dd42050 to 83a29f7 Compare April 2, 2026 03:49
@valarLip valarLip merged commit 06de6e9 into main Apr 6, 2026
25 checks passed
@valarLip valarLip deleted the refactor_hip_kernel branch April 6, 2026 05:00
yzhou103 pushed a commit that referenced this pull request Apr 8, 2026
* refactor hip kernel -- remove torch from csrc

* update

* hide stream in api

* update

* update

* update

* update

* update

* update

* update

* update

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants