Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/nightly-test-amd-rocm720.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Nightly Test (AMD ROCm 7.2)

on:
pull_request:
branches:
- main
schedule:
- cron: '0 2 * * *'
push:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/nightly-test-amd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Nightly Test (AMD)

on:
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * *'
push:
Expand Down
19 changes: 19 additions & 0 deletions python/sglang/srt/layers/rotary_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,25 @@ def forward_cuda(
)
return query, key

def forward_hip(
self,
positions: torch.Tensor,
query: torch.Tensor,
key: torch.Tensor,
offsets: Optional[torch.Tensor] = None,
fused_set_kv_buffer_arg: Optional[FusedSetKVBufferArg] = None,
) -> Tuple[torch.Tensor, torch.Tensor]:
"""HIP/ROCm implementation.

The JIT kernels (sglang.jit_kernel.pos_enc) used in forward_cuda's
fallback path depend on tvm_ffi which invokes nvidia-smi to detect
CUDA compute capability. This fails on AMD GPUs, so we use the
pure-PyTorch native implementation instead.
"""
return self.forward_native(
positions, query, key, offsets, fused_set_kv_buffer_arg
)

def extra_repr(self) -> str:
s = f"head_size={self.head_size}, rotary_dim={self.rotary_dim}"
s += f", max_position_embeddings={self.max_position_embeddings}"
Expand Down
Loading