# Kernel-generation task: Write a fast node-limited MoE dispatch (dedup + all-to-all send-buffer pack) kernel # # DeepSeek-V3's node-limited routing exists so that a token's experts live on at most a handful of nodes — and the payoff is collected right here, in the kernel that builds the all-to-all send buffer. A token routed to four experts on the same node is sent to that node ONCE, not four times, so the dispatch has to deduplicate every token's expert set down to a node set, rank the tokens per node, and gather the hidden states into node-major order. It is the largest tensor in the layer moved once, with an index computation that is anything but a memcpy. # # SCORING: correctness is a hard gate; the score is achieved GB/s (uncapped leaderboard, 0 if wrong). # There is no gold solution and no oracle, so nothing has to be vendored or sealed. # # TOOLCHAIN POLICY: the agent writes the kernel with Triton (+Gluon), CUDA C++ via nvcc, CUTLASS headers, or # the CuTe DSL. Enforcement is by ABSENCE, not by scanning: only the permitted toolchain is installed and # there is no internet, so nothing else can be obtained. # # GENERATED by _factory/build.py. FROM pytorch/pytorch:2.11.0-cuda12.8-cudnn9-devel # NOTE: every heavy layer comes FIRST and depends only on {base_image, pip_extra}, so all tasks in this # lane share the same cached layers. The task-specific COPYs are LAST. Do not reorder. RUN pip install --break-system-packages --no-cache-dir einops nvidia-cutlass-dsl && \ apt-get update && apt-get install -y --no-install-recommends iptables iproute2 curl ca-certificates build-essential git && \ curl -LsSf https://astral.sh/uv/install.sh | sh && \ /root/.local/bin/uv tool install mini-swe-agent # header-only CUTLASS for the agent's CUDA/CuTe route RUN git clone --depth 1 https://github.com/NVIDIA/cutlass /opt/cutlass && rm -rf /opt/cutlass/.git # pre-bake Claude Code; harbor's claude_code.install() skips when present RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \ apt-get install -y nodejs procps && \ npm install -g @anthropic-ai/claude-code && claude --version ENV PATH=/root/.local/bin:$PATH ENV DISABLE_TELEMETRY=1 DISABLE_AUTOUPDATER=1 DISABLE_ERROR_REPORTING=1 CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 COPY restrict-network.sh /app/restrict-network.sh RUN chmod +x /app/restrict-network.sh # strip apt sources LAST so harbor's post-firewall apt step is a no-op that succeeds RUN rm -rf /var/lib/apt/lists/* /etc/apt/sources.list /etc/apt/sources.list.d WORKDIR /app COPY CLAUDE.md PROCESS_MANAGEMENT.md /app/ # task-specific files LAST so the layers above stay shared across every task COPY reference.py /app/reference.py COPY measure.py /app/measure.py COPY dispatch_pack.py /app/dispatch_pack.py