ROCm HW support

This commit is contained in:
Dobromir Popov
2026-07-09 01:07:53 +03:00
parent 08826f6ace
commit 1d3d3018cd
5 changed files with 133 additions and 8 deletions

View File

@@ -24,6 +24,7 @@ from meshnet_node.model_backend import (
_should_partial_materialize_shard,
_decoder_attention_mask,
_int_tensor_header,
_torch_cuda_is_executable,
build_quantization_config,
validate_quantization,
)
@@ -209,6 +210,26 @@ def test_bitsandbytes_configs_are_created_lazily(monkeypatch):
]
def test_rocm_inventory_without_executable_kernels_is_not_used_as_cuda():
class FakeCuda:
@staticmethod
def is_available():
return True
@staticmethod
def synchronize():
raise AssertionError("synchronize should not run after empty() fails")
fake_torch = types.SimpleNamespace(
cuda=FakeCuda(),
empty=lambda *args, **kwargs: (_ for _ in ()).throw(
RuntimeError("HIP error: invalid device function")
),
)
assert _torch_cuda_is_executable(fake_torch) is False
def test_head_forward_accepts_text_prompt_and_returns_bfloat16_activations():
node = TorchNodeServer(backend=_FakeBackend())
port = node.start()