Skip to content

Commit 8ee5840

Browse files
authored
[AMD] Remove GlobalPrefetch and LocalPrefetch Knobs (#8295)
Removed `TRITON_HIP_GLOBAL_PREFETCH` and `TRITON_HIP_LOCAL_PREFETCH` to simplify pipeliner as no one is practically using it. This prepares us from upcoming restructuring of the pipeliner.
1 parent a7dab71 commit 8ee5840

File tree

9 files changed

+96
-263
lines changed

9 files changed

+96
-263
lines changed

include/triton/Tools/Sys/GetEnv.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ inline const std::set<std::string> CACHE_INVALIDATING_ENV_VARS = {
3232
"TRITON_DEFAULT_FP_FUSION",
3333
"TRITON_DISABLE_LINE_INFO",
3434
"TRITON_ENABLE_LLVM_DEBUG",
35-
"TRITON_HIP_GLOBAL_PREFETCH",
36-
"TRITON_HIP_LOCAL_PREFETCH",
3735
"TRITON_HIP_USE_ASYNC_COPY",
3836
"TRITON_HIP_USE_BLOCK_PINGPONG",
3937
"TRITON_HIP_USE_IN_THREAD_TRANSPOSE",

python/test/unit/test_knobs.py

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,12 @@ class test_knobs(triton.knobs.base_knobs):
6969

7070

7171
def test_knobs_scope(fresh_knobs, monkeypatch):
72-
fresh_knobs.amd.global_prefetch = 4
73-
fresh_knobs.amd.local_prefetch = 3
72+
fresh_knobs.amd.use_buffer_atomics = True
7473

7574
# Update env *after* the __set__() does
76-
monkeypatch.setenv("TRITON_HIP_LOCAL_PREFETCH", "17")
75+
monkeypatch.setenv("AMDGCN_USE_BUFFER_ATOMICS", "0")
7776

78-
assert fresh_knobs.amd.global_prefetch == 4
79-
assert fresh_knobs.amd.local_prefetch == 3
80-
assert fresh_knobs.amd.use_buffer_ops
77+
assert fresh_knobs.amd.use_buffer_atomics
8178

8279
# Just to prove that use_buffer_ops is coming from env
8380
monkeypatch.setenv("AMDGCN_USE_BUFFER_OPS", "0")
@@ -86,17 +83,14 @@ def test_knobs_scope(fresh_knobs, monkeypatch):
8683
assert fresh_knobs.amd.use_buffer_ops
8784

8885
with fresh_knobs.amd.scope():
89-
fresh_knobs.amd.global_prefetch = 5
9086
# Use the environment
91-
del fresh_knobs.amd.local_prefetch
87+
del fresh_knobs.amd.use_buffer_atomics
9288
fresh_knobs.amd.use_buffer_ops = False
9389

94-
assert fresh_knobs.amd.global_prefetch == 5
95-
assert fresh_knobs.amd.local_prefetch == 17
90+
assert not fresh_knobs.amd.use_buffer_atomics
9691
assert not fresh_knobs.amd.use_buffer_ops
9792

98-
assert fresh_knobs.amd.global_prefetch == 4
99-
assert fresh_knobs.amd.local_prefetch == 3
93+
assert fresh_knobs.amd.use_buffer_atomics
10094
assert fresh_knobs.amd.use_buffer_ops
10195

10296
# Just to prove that use_buffer_ops is coming from env
@@ -200,7 +194,7 @@ def test_set_knob_directly(fresh_knobs, monkeypatch):
200194
# Just in case, lets check all the other datatypes too
201195
fresh_knobs.language.default_fp_fusion = False
202196
fresh_knobs.amd.use_block_pingpong = True
203-
fresh_knobs.amd.global_prefetch = 5
197+
fresh_knobs.redis.port = 6380
204198
fresh_knobs.nvidia.mock_ptx_version = "42.0.1"
205199

206200
from triton.runtime.cache import FileCacheManager
@@ -213,27 +207,27 @@ class TestManagerClass(FileCacheManager):
213207
monkeypatch.setenv("TRITON_CUDART_PATH", "/tmp/the/real/cudart")
214208
monkeypatch.setenv("TRITON_DEFAULT_FP_FUSION", "1")
215209
monkeypatch.setenv("TRITON_HIP_USE_BLOCK_PINGPONG", "0")
216-
monkeypatch.setenv("TRITON_HIP_GLOBAL_PREFETCH", "2")
210+
monkeypatch.setenv("TRITON_REDIS_PORT", "6381")
217211
monkeypatch.setenv("TRITON_MOCK_PTX_VERSION", "1.0.0")
218212
monkeypatch.setenv("TRITON_CACHE_MANAGER", "triton.runtime.cache:FileCacheManager")
219213

220214
assert not fresh_knobs.language.default_fp_fusion
221215
assert fresh_knobs.amd.use_block_pingpong
222-
assert fresh_knobs.amd.global_prefetch == 5
216+
assert fresh_knobs.redis.port == 6380
223217
assert fresh_knobs.nvidia.mock_ptx_version == "42.0.1"
224218
assert fresh_knobs.cache.manager_class == TestManagerClass
225219

226220
# Make sure both setting `.env` or deleting resets to env vars.
227221
fresh_knobs.language.default_fp_fusion = fresh_knobs.env
228222
fresh_knobs.amd.use_block_pingpong = fresh_knobs.env
229-
fresh_knobs.amd.global_prefetch = fresh_knobs.env
223+
fresh_knobs.redis.port = fresh_knobs.env
230224
del fresh_knobs.nvidia.mock_ptx_version
231225
del fresh_knobs.cache.manager_class
232226

233227
assert fresh_knobs.build.backend_dirs == {"/tmp/the/real/cudart"}
234228
assert fresh_knobs.language.default_fp_fusion
235229
assert not fresh_knobs.amd.use_block_pingpong
236-
assert fresh_knobs.amd.global_prefetch == 2
230+
assert fresh_knobs.redis.port == 6381
237231
assert fresh_knobs.nvidia.mock_ptx_version == "1.0.0"
238232
assert fresh_knobs.cache.manager_class == FileCacheManager
239233

python/triton/knobs.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,6 @@ class amd_knobs(base_knobs):
508508
use_block_pingpong: env_opt_bool = env_opt_bool("TRITON_HIP_USE_BLOCK_PINGPONG")
509509
use_in_thread_transpose: env_opt_bool = env_opt_bool("TRITON_HIP_USE_IN_THREAD_TRANSPOSE")
510510

511-
global_prefetch: env_int = env_int("TRITON_HIP_GLOBAL_PREFETCH")
512-
local_prefetch: env_int = env_int("TRITON_HIP_LOCAL_PREFETCH")
513511
use_async_copy: env_bool = env_bool("TRITON_HIP_USE_ASYNC_COPY")
514512
scalarize_packed_fops: env_bool = env_bool("AMDGCN_SCALARIZE_PACKED_FOPS")
515513

test/TritonGPU/amd/amd-stream-prefetch.mlir

Lines changed: 0 additions & 121 deletions
This file was deleted.

0 commit comments

Comments
 (0)