Skip to content

Fix bench_mlp.py#9919

Merged
ThomasRaoux merged 7 commits intotriton-lang:mainfrom
CliveUnger:cu/fix-bench-mlp-mesh
Apr 16, 2026
Merged

Fix bench_mlp.py#9919
ThomasRaoux merged 7 commits intotriton-lang:mainfrom
CliveUnger:cu/fix-bench-mlp-mesh

Conversation

@CliveUnger
Copy link
Copy Markdown
Contributor

Fix's API issues in the bench_mlp.py script.

python/triton_kernels/bench/bench_mlp.py no longer ran with current Triton code.

Running:

  torchrun --nproc-per-node=1 python/triton_kernels/bench/bench_mlp.py

fails with

[rank0]: Traceback (most recent call last):
[rank0]:   File "/workspace/triton-source/python/triton_kernels/bench/bench_mlp.py", line 230, in <module>
[rank0]:     roofline_mlp(batch_sizes, 5760, 5760, 128, 4, dtypes[0], dtypes[1], ep, name="mlp_moe")
[rank0]:   File "/workspace/triton-source/python/triton_kernels/bench/bench_mlp.py", line 194, in roofline_mlp
[rank0]:     csv_path = roofline.compute_roofline(dim1, dim2, n_expts_tot, n_expts_act, parse_dtype(x_dtype),
[rank0]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/triton_kernels/roofline.py", line 73, in compute_roofline
[rank0]:     perf = inject_proxy_and_call(val, args, kwargs)
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/usr/local/lib/python3.12/dist-packages/triton_kernels/roofline.py", line 64, in inject_proxy_and_call
[rank0]:     return bench_fn(*args_list, **kwargs)
[rank0]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank0]:   File "/workspace/triton-source/python/triton_kernels/bench/bench_mlp.py", line 100, in bench_mlp
[rank0]:     symm_mem_pool = SymmetricMemoryPool()
[rank0]:                     ^^^^^^^^^^^^^^^^^^^^^
[rank0]: TypeError: SymmetricMemoryPool.__init__() missing 1 required positional argument: 'mesh'
E0403 20:14:38.021000 2225 torch/distributed/elastic/multiprocessing/api.py:988] failed (exitcode: 1) local_rank: 0 (pid: 2258) of binary: /usr/bin/python3
Traceback (most recent call last):
  File "/usr/local/bin/torchrun", line 6, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 367, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/torch/distributed/run.py", line 1016, in main
    run(args)
  File "/usr/local/lib/python3.12/dist-packages/torch/distributed/run.py", line 1007, in run
    elastic_launch(
  File "/usr/local/lib/python3.12/dist-packages/torch/distributed/launcher/api.py", line 184, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/torch/distributed/launcher/api.py", line 332, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
============================================================
python/triton_kernels/bench/bench_mlp.py FAILED
------------------------------------------------------------
Failures:
  <NO_OTHER_FAILURES>
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2026-04-03_20:14:38
  host      : ab3ee0d0c408
  rank      : 0 (local_rank: 0)
  exitcode  : 1 (pid: 2258)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html

@CliveUnger CliveUnger requested a review from ptillet as a code owner April 3, 2026 20:15
Comment thread python/triton_kernels/bench/bench_mlp.py Outdated
Copy link
Copy Markdown
Collaborator

@ThomasRaoux ThomasRaoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# Conflicts:
#	python/triton_kernels/bench/bench_mlp.py
@ThomasRaoux ThomasRaoux enabled auto-merge (squash) April 16, 2026 20:57
@ThomasRaoux ThomasRaoux merged commit fa4db31 into triton-lang:main Apr 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants