error
30_broadcast_masked_from_row0.py
started
2026-05-02T20:47:49Z
reference PyTorch source (the prompt the agent sees)
"""
Simulated broadcast of row 0 into masked columns for all rows: where mask[j] is True,
every row matches x[0, j]; elsewhere keep x[b, j].
"""
import torch
import torch.nn as nn
from kernelbench.distributed_collectives import default_device
B = 18
D = 44
# Fixed mask (not all True, not all False)
_MASK = torch.tensor(
[1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],
dtype=torch.bool,
)
class Model(nn.Module):
def __init__(self):
super().__init__()
self.register_buffer("row_mask", _MASK.clone(), persistent=False)
def forward(self, x: torch.Tensor) -> torch.Tensor:
m = self.row_mask.to(device=x.device).view(1, D).expand(B, D)
row0 = x[0:1].expand(B, D)
return torch.where(m, row0, x)
def get_inputs():
dev = default_device()
return [torch.randn(popcorn_pri.jitter_int(B), D, device=dev)]
def get_init_inputs():
return []
turn 08.3s turn · 8.3s LLM · 0.0s tools
call → get_gpu_specs
callget_gpu_specs
{}
result ← get_gpu_specs (fail)
failget_gpu_specs
get_gpu_specs FAILED: unexpected error during tool execution.
_WorkItemTimeout: work item exceeded soft timeout budget
Traceback (most recent call last):
File "/scratch/tejas/PopcornBench/src/kernelbench/agent/agent.py", line 627, in _execute_tool
return tool.execute(self.ctx, **args)
File "/scratch/tejas/PopcornBench/src/kernelbench/agent/tools.py", line 656, in execute
return ctx.eval_client.get_gpu_specs(ctx)
File "/scratch/tejas/PopcornBench/src/kernelbench/agent/eval_client.py", line 62, in get_gpu_specs
return self._call("specs", args)
File "/scratch/tejas/PopcornBench/src/kernelbench/agent/eval_client.py", line 117, in _call
payload = self._response_q.get(timeout=remaining)
File "<string>", line 2, in get
File "/home/prabhune/.local/share/uv/python/cpython-3.10-linux-x86_64-gnu/lib/python3.10/multiprocessing/managers.py", line 818, in _callmethod
kind, result = conn.recv()
File "/home/prabhune/.local/share/uv/python/cpython-3.10-linux-x86_64-gnu/lib/python3.10/multiprocessing/connection.py", line 250, in recv
buf = self._recv_bytes()
File "/home/prabhune/.local/share/uv/python/cpython-3.10-linux-x86_64-gnu/lib/python3.10/multiprocessing/connection.py", line 414, in _recv_bytes
buf = self._recv(4)
File "/home/prabhune/.local/share/uv/python/cpython-3.10-linux-x86_64-gnu/lib/python3.10/multiprocessing/connection.py", line 379, in _recv
chunk = read(handle, remaining)
File "/scratch/tejas/PopcornBench/scripts/run_sweep.py", line 161, in _alarm_handler
raise _WorkItemTimeout("work item exceeded soft timeout budget")
__mp_main__._WorkItemTimeout: work item exceeded soft timeout budget
turn 18.3s turn · 8.3s LLM · 0.0s tools
feedbackLLM call failed: Empty: