bugger.
All challenges/Pythonmediumcuda-tiled-matmul-v1
THE INVESTIGATION

Multiply with partial tiles

Compute a matrix product while handling incomplete inner tiles.

LLM ArchitectureML systems

What’s going wrong

Original LLM Architecture lab. This CUDA fundamentals exercise is a deterministic Python simulation, not CUDA code or GPU execution. Implement solve(data) using the Python standard library.

Given rectangular matrices a and b with compatible dimensions and a positive tile_size, return {"product": matrix}. Compute each output as the sum over the shared dimension, processing that dimension in chunks of tile_size and including the final partial chunk. a has at least one row; b may be empty only when the shared dimension is zero. If b is empty, each output row is empty.

Expected behavior

Compute a matrix product while handling incomplete inner tiles.

Reproduction

01 Case 1
{"a": [[1, 2, 3]], "b": [[1], [2], [3]], "tile_size": 2}
{"product": [[14]]}
02 Case 2
{"a": [[1, 2]], "b": [[2], [3]], "tile_size": 2}
{"product": [[8]]}
03 Case 3
{"a": [[]], "b": [], "tile_size": 2}
{"product": [[]]}

Before you begin

  • Python lists and loops

Need a nudge?

Reveal one investigation hint at a time. Try each clue before opening the next.

    The bug is intentional. Run the starter code to see it fail, then work toward a fix. Difficulty is provisional.
    Read-only preview
    Ready when you are
    Every fix starts with a failing test.

    Read the report, then sign in to start your investigation.