Skip to content

Commit b6aead6

Browse files
[AutoPGLE] Explicitly disable command buffers when profiler is used.
PiperOrigin-RevId: 709475833
1 parent 64511a1 commit b6aead6

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

jax/_src/compiler.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ def get_compile_options(
192192
build_options.exec_time_optimization_effort = config.exec_time_optimization_effort.value
193193
build_options.memory_fitting_effort = config.memory_fitting_effort.value
194194

195+
# This is a temporary workaround to simplify the AutoPGLE usage.
196+
# TODO(b/376647494): Remove once the bug is fixed.
197+
if config.enable_pgle.value and config.pgle_profiling_runs.value > 0:
198+
logger.debug("Explicitly disabling command buffer scheduling for AutoPGLE.")
199+
if env_options_overrides is None:
200+
env_options_overrides = {}
201+
env_options_overrides['xla_gpu_enable_command_buffer'] = ''
202+
195203
if env_options_overrides is not None:
196204
# Some overrides are passed directly on build_options.
197205
overrides_on_build_options = [

tests/pgle_test.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ def testPGLEProfilerGetFDOProfileLarge(self):
9595
out_shardings=NamedSharding(mesh, PartitionSpec('x')),
9696
compiler_options={
9797
'xla_gpu_enable_latency_hiding_scheduler': 'True',
98-
# TODO(patrios): Remove this flag once b/376647494 is fixed.
99-
'xla_gpu_graph_min_graph_size': '100000',
98+
# TODO(b/37664749): Remove this flag once the bug is fixed.
99+
'xla_gpu_enable_command_buffer': '',
100100
},
101101
)
102102
def f(x):
@@ -133,8 +133,6 @@ def testAutoPgle(self):
133133
out_shardings=NamedSharding(mesh, PartitionSpec('x')),
134134
compiler_options={
135135
'xla_gpu_enable_latency_hiding_scheduler': 'True',
136-
# TODO(patrios): Remove this flag once b/376647494 is fixed.
137-
'xla_gpu_graph_min_graph_size': '100000',
138136
'xla_dump_to': dump_dir,
139137
'xla_gpu_experimental_dump_fdo_profiles': 'True'
140138
},
@@ -217,8 +215,6 @@ def testAutoPgleWithPersistentCache(self):
217215
out_shardings=NamedSharding(mesh, PartitionSpec('x')),
218216
compiler_options={
219217
'xla_gpu_enable_latency_hiding_scheduler': 'True',
220-
# TODO(patrios): Remove this flag once b/376647494 is fixed.
221-
'xla_gpu_graph_min_graph_size': '100000',
222218
'xla_dump_to': dump_dir,
223219
'xla_gpu_experimental_dump_fdo_profiles': 'True'
224220
},

0 commit comments

Comments
 (0)