Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 0 additions & 113 deletions examples/distributed/example_allgather_gemm.py

This file was deleted.

28 changes: 28 additions & 0 deletions examples/distributed/intranode/test_intranode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import torch
import tilelang
import tilelang.testing

import example_allgather_gemm_overlapped
import example_gemm_rs_overlapped
import example_sp_ag_attention_intra_node


@tilelang.testing.requires_distributed
@tilelang.testing.requires_cuda
@tilelang.testing.requires_cuda_compute_version_eq(9, 0)
def test_example_allgather_gemm_overlapped():
torch.multiprocessing.spawn(example_allgather_gemm_overlapped.main, args=(2, None), nprocs=2)
Comment on lines +13 to +14
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, find the location of the example modules
find . -name "example_allgather_gemm_overlapped.py" -o -name "example_gemm_rs_overlapped.py" -o -name "example_sp_ag_attention_intra_node.py" | head -20

Repository: tile-ai/tilescale

Length of output: 264


🏁 Script executed:

#!/bin/bash
# Extract main function definitions with context
for f in ./examples/distributed/intranode/example_allgather_gemm_overlapped.py ./examples/distributed/intranode/example_gemm_rs_overlapped.py ./examples/distributed/intranode/example_sp_ag_attention_intra_node.py; do
  echo "=== $(basename $f) ==="
  sed -n '/^def main/,/^def \|^class \|^$/p' "$f" | head -40
done

Repository: tile-ai/tilescale

Length of output: 931


🏁 Script executed:

#!/bin/bash
# Get the full main function for each module (up to 60 lines)
for f in ./examples/distributed/intranode/example_allgather_gemm_overlapped.py ./examples/distributed/intranode/example_gemm_rs_overlapped.py ./examples/distributed/intranode/example_sp_ag_attention_intra_node.py; do
  echo "=== $(basename $f) ==="
  sed -n '/^def main/,/^def \|^class \|^$/p' "$f" | head -60
  echo ""
done

Repository: tile-ai/tilescale

Length of output: 934


🏁 Script executed:

#!/bin/bash
# Check the test file to confirm args pattern
echo "=== test_intranode.py ==="
cat -n examples/distributed/intranode/test_intranode.py

echo ""
echo "=== Checking for any args usage in example_sp_ag_attention_intra_node.py ==="
grep -n "args\." examples/distributed/intranode/example_sp_ag_attention_intra_node.py || echo "No args. accesses found"

Repository: tile-ai/tilescale

Length of output: 1792


All three main functions will crash with AttributeError when args=None is passed.

The tests call torch.multiprocessing.spawn(..., args=(2, None), nprocs=2), which passes None as the third argument to each main function. However:

  • example_allgather_gemm_overlapped.main and example_gemm_rs_overlapped.main unconditionally access args.persistent on line 5.
  • example_sp_ag_attention_intra_node.main unconditionally accesses args.batch_size, args.q_head, and multiple other attributes (lines 293-304, 409).

All three will fail with AttributeError: 'NoneType' object has no attribute .... Either pass valid args or add None checks to all attribute accesses in these functions.

🤖 Prompt for AI Agents
In `@examples/distributed/intranode/test_intranode.py` around lines 13 - 14, The
test passes args=(2, None) which sends None into the main functions and causes
AttributeError when they access attributes; update the test
(test_example_allgather_gemm_overlapped) to pass a minimal valid args object
(e.g., an argparse.Namespace or simple object) containing the attributes
expected by example_allgather_gemm_overlapped.main,
example_gemm_rs_overlapped.main and example_sp_ag_attention_intra_node.main (at
least persistent for the first two, and batch_size, q_head, etc. for the
attention example), or alternately add defensive checks inside those main
functions to handle args is None before accessing attributes — pick one approach
and implement it consistently for the three mains named above.



@tilelang.testing.requires_distributed
@tilelang.testing.requires_cuda
@tilelang.testing.requires_cuda_compute_version_eq(9, 0)
def test_example_gemm_rs_overlapped():
torch.multiprocessing.spawn(example_gemm_rs_overlapped.main, args=(2, None), nprocs=2)


@tilelang.testing.requires_distributed
@tilelang.testing.requires_cuda
@tilelang.testing.requires_cuda_compute_version_eq(9, 0)
def test_example_sp_ag_attention_intra_node():
torch.multiprocessing.spawn(example_sp_ag_attention_intra_node.main, args=(2, None), nprocs=2)