From 7745e05a2f398443172eeddfbfb738387bc2a96e Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Thu, 23 Apr 2026 22:21:22 +0300 Subject: [PATCH] sqtt: update wave end packet names (#15896) * sqtt: update wave end packet names * update wavestart and emu --- test/mockgpu/amd/emu.py | 4 ++-- tinygrad/renderer/amd/sqtt.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/mockgpu/amd/emu.py b/test/mockgpu/amd/emu.py index 2c72128f02..0e87ca23f2 100644 --- a/test/mockgpu/amd/emu.py +++ b/test/mockgpu/amd/emu.py @@ -161,7 +161,7 @@ def _init_sqtt_encoder(): """Emit an SQTT packet for one executed instruction.""" w = wave_id & 0x1F if wave_id not in started: - _emit_nibbles(nibbles, WAVESTART, delta=1, simd=0, cu_lo=0, wave=w, id7=wave_id) + _emit_nibbles(nibbles, WAVESTART, delta=1, simd=0, wgp=0, wave=w, id7=wave_id) started.add(wave_id) inst_type, inst_op, op_name = type(inst), inst.op.value if hasattr(inst, 'op') else 0, inst.op.name if hasattr(inst, 'op') else "" if issubclass(inst_type, _SOPP): @@ -180,7 +180,7 @@ def _init_sqtt_encoder(): def finish(wave_id: int): """Emit WAVEEND for a completed wave.""" - if wave_id in started: _emit_nibbles(nibbles, WAVEEND, delta=1, simd=0, cu_lo=0, wave=wave_id & 0x1F) + if wave_id in started: _emit_nibbles(nibbles, WAVEEND, delta=1, simd=0, wgp=0, wave=wave_id & 0x1F) def finalize() -> bytes: """Pad and return the encoded SQTT blob.""" diff --git a/tinygrad/renderer/amd/sqtt.py b/tinygrad/renderer/amd/sqtt.py index 51aa83abae..82763480ec 100644 --- a/tinygrad/renderer/amd/sqtt.py +++ b/tinygrad/renderer/amd/sqtt.py @@ -288,34 +288,34 @@ class WAVERDY(PacketType): # exclude: 1 << 3 class WAVEEND(PacketType): # exclude: 1 << 4 encoding = bits[4:0] == 0b10101 delta = bits[7:5] - flag7 = bits[8:8] + sa = bits[8:8] simd = bits[10:9] - cu_lo = bits[13:11] + wgp = bits[13:11] wave = bits[19:15] @property - def cu(self) -> int: return self.cu_lo | (self.flag7 << 3) + def cu(self) -> int: return self.wgp | (self.sa << 3) class WAVESTART(PacketType): # exclude: 1 << 4 encoding = bits[4:0] == 0b01100 delta = bits[6:5] - flag7 = bits[7:7] + sa = bits[7:7] simd = bits[9:8] - cu_lo = bits[12:10] + wgp = bits[12:10] wave = bits[17:13] id7 = bits[31:18] @property - def cu(self) -> int: return self.cu_lo | (self.flag7 << 3) + def cu(self) -> int: return self.wgp | (self.sa << 3) class WAVESTART_RDNA4(PacketType): # Layout 4 has wave field at different position encoding = bits[4:0] == 0b01100 delta = bits[6:5] - flag7 = bits[7:7] + sa = bits[7:7] simd = bits[9:8] - cu_lo = bits[12:10] + wgp = bits[12:10] wave = bits[19:15] id7 = bits[31:20] @property - def cu(self) -> int: return self.cu_lo | (self.flag7 << 3) + def cu(self) -> int: return self.wgp | (self.sa << 3) class WAVEALLOC(PacketType): # exclude: 1 << 10 encoding = bits[4:0] == 0b00101