Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 15, 2025

This PR adds a new medium difficulty challenge for FP16 batched matrix multiplication.

Challenge Overview

The challenge implements batched matrix multiplication using 16-bit floating point numbers (FP16/half). Given a batch of matrices A of shape [B, M, K] and B of shape [B, K, N], participants compute the output batch C of shape [B, M, N] where C_b = A_b × B_b for each batch index b.

Key Features

  • Data Type: Uses FP16 (half precision) for input/output matrices
  • Precision Handling: Requires FP32 accumulation during multiplication for better numerical stability
  • Constraints: Supports up to 128 batches and matrix dimensions up to 1024
  • Test Coverage: Includes 6 functional tests covering various batch sizes and matrix shapes
  • Performance Test: BATCH=32, M=N=K=256

Implementation Details

The challenge combines concepts from:

Starter templates are provided for:

  • CUDA (with cuda_fp16.h and half type)
  • Mojo (Float16)
  • PyTorch
  • Triton
  • CuTe

All starter files follow the medium difficulty pattern with empty solve functions, allowing participants to implement their own optimized solutions.

Original prompt

Create a new challenge for FP16 batched matmul as a medium


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Create new medium challenge for FP16 batched matmul Add FP16 Batched Matrix Multiplication Challenge (Medium #56) Oct 15, 2025
Copilot finished work on behalf of kunal-mansukhani October 15, 2025 04:06
@kunal-mansukhani kunal-mansukhani marked this pull request as ready for review October 15, 2025 04:07
@kunal-mansukhani
Copy link
Contributor

@copilot 56 is duplicated. use something else

Copy link
Contributor Author

Copilot AI commented Oct 15, 2025

@copilot 56 is duplicated. use something else

Renamed to challenge 57 to avoid duplication with hard/56_linear_attention (commit 4381820)

Copilot AI changed the title Add FP16 Batched Matrix Multiplication Challenge (Medium #56) Add FP16 Batched Matrix Multiplication Challenge (Medium #57) Oct 15, 2025
@kunal-mansukhani kunal-mansukhani merged commit 0cd0079 into main Oct 15, 2025
2 checks passed
Copilot finished work on behalf of kunal-mansukhani October 15, 2025 04:13
@kunal-mansukhani kunal-mansukhani deleted the copilot/create-fp16-batched-matmuls branch October 15, 2025 04:13
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