From 5d485660da83676e12d17da431f2ffda13d6869c Mon Sep 17 00:00:00 2001 From: George Hotz Date: Wed, 15 Oct 2025 09:19:56 +0800 Subject: [PATCH] reproed failure in emulation --- .github/workflows/test.yml | 2 ++ tinygrad/runtime/ops_null.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 72d7f1a458..9ea57b843b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -272,6 +272,8 @@ jobs: # run: NULL=1 DEBUG=1 python3 examples/sdxl.py --seed 0 --noshow --timing --fakeweights - name: Run Clip tests for SD MLPerf on NULL backend run: NULL=1 python -m pytest -n=auto test/external/mlperf_stable_diffusion/external_test_models.py::TestOpenClip --durations=20 + - name: Run AMD emulated BERT training on NULL backend + run: EMULATE=AMD_RDNA4 NULL=1 CAPTURE_PROCESS_REPLAY=0 DEFAULT_FLOAT=HALF BENCHMARK=10 BS=66 GPUS=1 BERT_LAYERS=2 MODEL=bert python3 examples/mlperf/model_train.py # TODO: support fake weights #- name: Run LLaMA 7B on 4 fake devices # run: NULL=1 python3 examples/llama.py --gen 1 --size 7B --shard 4 --prompt "Hello." --count 3 --temperature 0 --timing diff --git a/tinygrad/runtime/ops_null.py b/tinygrad/runtime/ops_null.py index cd9779ebb1..7d64fee1c0 100644 --- a/tinygrad/runtime/ops_null.py +++ b/tinygrad/runtime/ops_null.py @@ -2,7 +2,8 @@ import functools from typing import cast from tinygrad.device import Compiled, Compiler, Allocator from tinygrad.engine.jit import MultiGraphRunner -from tinygrad.renderer.cstyle import Renderer, CStyleLanguage, AMDRenderer +from tinygrad.renderer.cstyle import Renderer, CStyleLanguage +from tinygrad.renderer.llvmir import AMDLLVMRenderer from tinygrad.uop.ops import Ops from tinygrad.helpers import cpu_profile, EMULATE @@ -33,7 +34,8 @@ class NullDevice(Compiled): def __init__(self, device:str): renderer:functools.partial|type[Renderer] match cast(str, EMULATE.value): - case "AMD": renderer = functools.partial(AMDRenderer, "gfx1100") + case "AMD": renderer = functools.partial(AMDLLVMRenderer, "gfx1100") + case "AMD_RDNA4": renderer = functools.partial(AMDLLVMRenderer, "gfx1201") case "": renderer = NullRenderer case _: raise RuntimeError(f"can't EMULATE device: {EMULATE.value}") super().__init__(device, NullAllocator(self), [(renderer, Compiler)], functools.partial(NullProgram, device), NullGraph)