MCPcopy Create free account

hub / github.com/AlphaGPU/leetgpu-challenges / functions

Functions919 in github.com/AlphaGPU/leetgpu-challenges

Methodget_solve_signature
(self)
challenges/easy/23_leaky_relu/challenge.py:25
Methodget_solve_signature
(self)
challenges/easy/9_1d_convolution/challenge.py:52
Methodget_solve_signature
(self)
challenges/easy/19_reverse_array/challenge.py:22
Methodget_solve_signature
(self)
challenges/easy/54_swiglu/challenge.py:25
Methodget_solve_signature
(self)
challenges/easy/68_sigmoid/challenge.py:22
Methodget_solve_signature
(self)
challenges/easy/41_simple_inference/challenge.py:23
Methodget_solve_signature
(self)
challenges/easy/65_geglu/challenge.py:27
Methodget_solve_signature
(self)
challenges/easy/63_interleave/challenge.py:25
Methodget_solve_signature
(self)
challenges/easy/3_matrix_transpose/challenge.py:23
Methodget_solve_signature
(self)
challenges/easy/21_relu/challenge.py:24
Methodget_solve_signature
(self)
challenges/easy/52_silu/challenge.py:23
Methodget_solve_signature
(self)
challenges/easy/1_vector_add/challenge.py:22
Methodget_solve_signature
(self)
challenges/easy/66_rgb_to_grayscale/challenge.py:32
Methodget_solve_signature
(self)
challenges/easy/31_matrix_copy/challenge.py:24
Methodget_solve_signature
(self)
challenges/easy/8_matrix_addition/challenge.py:24
Methodget_solve_signature
(self)
challenges/easy/7_color_inversion/challenge.py:25
Functiongrid
(meta)
challenges/easy/63_interleave/starter/starter.triton.py:15
Functioninterleave_kernel
(A_ptr, B_ptr, output_ptr, N, BLOCK_SIZE: tl.constexpr)
challenges/easy/63_interleave/starter/starter.triton.py:7
Functioninvert_kernel
(image, width, height, BLOCK_SIZE: tl.constexpr)
challenges/easy/7_color_inversion/starter/starter.triton.py:7
Functionleaky_relu_kernel
(input, output, n_elements, BLOCK_SIZE: tl.constexpr)
challenges/easy/23_leaky_relu/starter/starter.triton.py:7
Methodmake_case
(M, N, low=-1.0, high=1.0)
challenges/medium/78_2d_fft/challenge.py:49
Methodmake_case
(B, L, D, K, x_vals=None, w_vals=None, b_vals=None)
challenges/medium/90_causal_depthwise_conv1d/challenge.py:113
Methodmake_impulse_case
(M, N)
challenges/medium/78_2d_fft/challenge.py:59
Methodmake_output
(N)
challenges/hard/73_all_pairs_shortest_paths/challenge.py:82
Methodmake_random_test
(N, avg_seg_len, seed=None)
challenges/medium/70_segmented_prefix_sum/challenge.py:87
Methodmake_test
vals: list of floats, segs: list of segment start indices
challenges/medium/70_segmented_prefix_sum/challenge.py:74
Methodmake_zero_case
(M, N)
challenges/medium/78_2d_fft/challenge.py:54
Functionmatrix_add_kernel
(a, b, c, n_elements, BLOCK_SIZE: tl.constexpr)
challenges/easy/8_matrix_addition/starter/starter.triton.py:7
Functionmatrix_multiplication_kernel
( a, b, c, M, N, K, stride_am, stride_an, stride_bn, stride_bk, stride_cm, stride_ck )
challenges/easy/2_matrix_multiplication/starter/starter.triton.py:7
Functionmatrix_transpose_kernel
(input, output, rows, cols, stride_ir, stride_ic, stride_or, stride_oc)
challenges/easy/3_matrix_transpose/starter/starter.triton.py:7
Functionradix_sort_kernel
(input, output, N)
challenges/hard/36_radix_sort/starter/starter.triton.py:7
Methodreference_impl
Ground-truth implementation using torch.fft. Assumes both tensors are on the same device (CPU or CUDA). Works for any N (power-of-tw
challenges/hard/39_Fast_Fourier_transform/challenge.py:15
Methodreference_impl
( self, x: torch.Tensor, output: torch.Tensor, weights: torch.Tensor,
challenges/hard/74_gpt2_block/challenge.py:38
Methodreference_impl
(self, dist: torch.Tensor, output: torch.Tensor, N: int)
challenges/hard/73_all_pairs_shortest_paths/challenge.py:30
Methodreference_impl
( self, Q: torch.Tensor, K: torch.Tensor, V: torch.Tensor, output: tor
challenges/hard/59_sliding_window_attn/challenge.py:15
Methodreference_impl
( self, x: torch.Tensor, output: torch.Tensor, weights: torch.Tensor,
challenges/hard/93_llama_transformer_block/challenge.py:39
Methodreference_impl
(self, agents: torch.Tensor, agents_next: torch.Tensor, N: int)
challenges/hard/14_multi_agent_sim/challenge.py:15
Methodreference_impl
(self, data: torch.Tensor, N: int)
challenges/hard/15_sorting/challenge.py:15
Methodreference_impl
( self, data_x: torch.Tensor, data_y: torch.Tensor, labels: torch.Tensor,
challenges/hard/20_kmeans_clustering/challenge.py:15
Methodreference_impl
( self, Q: torch.Tensor, K: torch.Tensor, V: torch.Tensor, output: tor
challenges/hard/56_linear_attention/challenge.py:15
Methodreference_impl
( self, Q: torch.Tensor, K: torch.Tensor, V: torch.Tensor, output: tor
challenges/hard/12_multi_head_attention/challenge.py:15
Methodreference_impl
(self, input: torch.Tensor, output: torch.Tensor, N: int)
challenges/hard/36_radix_sort/challenge.py:15
Methodreference_impl
Reference implementation that finds shortest path using BFS. Args: grid: Flattened 2D grid of size rows*cols (0=free, 1=
challenges/hard/46_bfs_shortest_path/challenge.py:15
Methodreference_impl
( self, Q: torch.Tensor, K: torch.Tensor, V: torch.Tensor, output: tor
challenges/hard/53_casual_attention/challenge.py:15
Methodreference_impl
Reference solution implementation.
challenges/core/challenge_base.py:64
Methodreference_impl
( self, Q: torch.Tensor, K: torch.Tensor, V: torch.Tensor, output: tor
challenges/medium/55_attn_w_linear_bias/challenge.py:15
Methodreference_impl
(self, signal: torch.Tensor, spectrum: torch.Tensor, M: int, N: int)
challenges/medium/78_2d_fft/challenge.py:15
Methodreference_impl
( self, y_samples: torch.Tensor, result: torch.Tensor, a: float, b: float, n_samples: int )
challenges/medium/35_monte_carlo_integration/challenge.py:15
Methodreference_impl
( self, A: torch.Tensor, B: torch.Tensor, C: torch.Tensor, M: int,
challenges/medium/32_int8_quantized_matmul/challenge.py:15
Methodreference_impl
Computes the Top-K gating for Mixture of Experts. For each row in logits, select the k highest values, apply softmax to them,
challenges/medium/67_moe_topk_gating/challenge.py:15
Methodreference_impl
( self, Q: torch.Tensor, K: torch.Tensor, V: torch.Tensor, output: tor
challenges/medium/80_grouped_query_attention/challenge.py:16
Methodreference_impl
( self, a: torch.Tensor, x: torch.Tensor, h: torch.Tensor, B: int,
challenges/medium/82_linear_recurrence/challenge.py:15
Methodreference_impl
(self, input: torch.Tensor, output: torch.Tensor, N: int)
challenges/medium/16_prefix_sum/challenge.py:15
Methodreference_impl
(self, A: torch.Tensor, N: int, out: torch.Tensor)
challenges/medium/72_stream_compaction/challenge.py:15
Methodreference_impl
(self, input: torch.Tensor, output: torch.Tensor, N: int, k: int)
challenges/medium/29_top_k_selection/challenge.py:15
Methodreference_impl
( self, input: torch.Tensor, gamma: torch.Tensor, beta: torch.Tensor,
challenges/medium/40_batch_normalization/challenge.py:15
Methodreference_impl
( self, logits: torch.Tensor, p: torch.Tensor, seed: torch.Tensor, sam
challenges/medium/60_top_p_sampling/challenge.py:15
Methodreference_impl
( self, Q: torch.Tensor, K: torch.Tensor, V: torch.Tensor, output: tor
challenges/medium/92_decaying_causal_attention/challenge.py:16
Methodreference_impl
( self, input: torch.Tensor, output: torch.Tensor, rows: int, cols: in
challenges/medium/69_jacobi_stencil_2d/challenge.py:15
Methodreference_impl
( self, input: torch.Tensor, output: torch.Tensor, N: int, M: int,
challenges/medium/48_2d_subarray_sum/challenge.py:15
Methodreference_impl
( self, x: torch.Tensor, W_gate: torch.Tensor, W_up: torch.Tensor, W_d
challenges/medium/84_swiglu_mlp_block/challenge.py:16
Methodreference_impl
(self, input: torch.Tensor, output: torch.Tensor, N: int, K: int)
challenges/medium/43_count_array_element/challenge.py:15
Methodreference_impl
(self, A: torch.Tensor, B: torch.Tensor, result: torch.Tensor, N: int)
challenges/medium/17_dot_product/challenge.py:15
Methodreference_impl
( self, Q: torch.Tensor, cos: torch.Tensor, sin: torch.Tensor, output:
challenges/medium/61_rope_embedding/challenge.py:15
Methodreference_impl
Matrix power implementation using PyTorch. Raises an N x N matrix to integer power P.
challenges/medium/37_matrix_power/challenge.py:15
Methodreference_impl
( self, logits: torch.Tensor, true_labels: torch.Tensor, loss: torch.Tensor, N: int, C: int )
challenges/medium/25_categorical_cross_entropy_loss/challenge.py:15
Methodreference_impl
( self, token_ids: torch.Tensor, position_ids: torch.Tensor, token_embeddings:
challenges/medium/106_token_embedding_layer/challenge.py:15
Methodreference_impl
( self, A: torch.Tensor, B: torch.Tensor, C: torch.Tensor, BATCH: int, M: int, N: int, K: int )
challenges/medium/57_fp16_batched_matmul/challenge.py:15
Methodreference_impl
( self, X: torch.Tensor, S: torch.Tensor, Y: torch.Tensor, M: int, N: int, TILE_SIZE: int )
challenges/medium/64_weight_dequantization/challenge.py:15
Methodreference_impl
( self, A: torch.Tensor, B: torch.Tensor, C: torch.Tensor, M: int,
challenges/medium/75_sparse_matrix_dense_matrix_multiplication/challenge.py:15
Methodreference_impl
( self, u: torch.Tensor, delta: torch.Tensor, A: torch.Tensor, B: torc
challenges/medium/94_ssm_selective_scan/challenge.py:15
Methodreference_impl
( self, input: torch.Tensor, kernel: torch.Tensor, output: torch.Tensor,
challenges/medium/28_gaussian_blur/challenge.py:15
Methodreference_impl
( self, input: torch.Tensor, kernel: torch.Tensor, output: torch.Tensor,
challenges/medium/10_2d_convolution/challenge.py:15
Methodreference_impl
(self, input: torch.Tensor, output: torch.Tensor, N: int, window_size: int)
challenges/medium/51_max_subarray_sum/challenge.py:15
Methodreference_impl
( self, x: torch.Tensor, w_q: torch.Tensor, scales: torch.Tensor, y: t
challenges/medium/81_int4_matmul/challenge.py:15
Methodreference_impl
( self, x: torch.Tensor, W: torch.Tensor, A: torch.Tensor, B: torch.Te
challenges/medium/85_lora_linear/challenge.py:15
Methodreference_impl
( self, input: torch.Tensor, gamma: float, beta: float, output: torch.
challenges/medium/50_rms_normalization/challenge.py:15
Methodreference_impl
( self, Q: torch.Tensor, K_int8: torch.Tensor, V_int8: torch.Tensor, k
challenges/medium/96_int8_kv_cache_attention/challenge.py:16
Methodreference_impl
( self, draft_tokens: torch.Tensor, draft_probs: torch.Tensor, target_probs: t
challenges/medium/87_speculative_decoding_verification/challenge.py:15
Methodreference_impl
( self, input: torch.Tensor, output: torch.Tensor, N: int, C: int,
challenges/medium/42_2d_max_pooling/challenge.py:15
Methodreference_impl
( self, X: torch.Tensor, gamma: torch.Tensor, beta: torch.Tensor, Y: t
challenges/medium/105_group_normalization/challenge.py:16
Methodreference_impl
(self, input: torch.Tensor, output: torch.Tensor, N: int, S: int, E: int)
challenges/medium/47_subarray_sum/challenge.py:15
Methodreference_impl
( self, x: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor, out
challenges/medium/90_causal_depthwise_conv1d/challenge.py:16
Methodreference_impl
( self, prompts: torch.Tensor, output: torch.Tensor, weights: torch.Tensor,
challenges/medium/76_adder_transformer/challenge.py:185
Methodreference_impl
(self, input: torch.Tensor, histogram: torch.Tensor, N: int, num_bins: int)
challenges/medium/13_histogramming/challenge.py:15
Methodreference_impl
(self, input: torch.Tensor, output: torch.Tensor, N: int)
challenges/medium/4_reduction/challenge.py:15
Methodreference_impl
( self, input: torch.Tensor, kernel: torch.Tensor, output: torch.Tensor,
challenges/medium/11_3d_convolution/challenge.py:15
Methodreference_impl
(self, input: torch.Tensor, output: torch.Tensor, N: int, M: int, K: int)
challenges/medium/44_count_2d_array_element/challenge.py:15
Methodreference_impl
( self, input: torch.Tensor, output: torch.Tensor, N: int, M: int, K: int, P: int )
challenges/medium/45_count_3d_array_element/challenge.py:15
Methodreference_impl
( self, input: torch.Tensor, output: torch.Tensor, N: int, M: int,
challenges/medium/49_3d_subarray_sum/challenge.py:15
Methodreference_impl
(self, input: torch.Tensor, output: torch.Tensor, N: int)
challenges/medium/5_softmax/challenge.py:15
Methodreference_impl
( self, predictions: torch.Tensor, targets: torch.Tensor, mse: torch.Tensor, N: int )
challenges/medium/27_mean_squared_error/challenge.py:15
Methodreference_impl
( self, A: torch.Tensor, B: torch.Tensor, C: torch.Tensor, BATCH: int, M: int, N: int, K: int )
challenges/medium/30_batched_matrix_multiplication/challenge.py:15
Methodreference_impl
( self, A: torch.Tensor, B: torch.Tensor, C: torch.Tensor, M: int,
challenges/medium/22_gemm/challenge.py:15
Methodreference_impl
Logistic regression using Newton-Raphson (IRLS) in PyTorch. This converges faster and more accurately than plain gradient descent.
challenges/medium/34_logistic_regression/challenge.py:15
Methodreference_impl
( self, A: torch.Tensor, B: torch.Tensor, C: torch.Tensor, M: int,
challenges/medium/71_parallel_merge/challenge.py:15
Methodreference_impl
( self, Q: torch.Tensor, K: torch.Tensor, V: torch.Tensor, output: tor
challenges/medium/6_softmax_attention/challenge.py:15
Methodreference_impl
( self, values: torch.Tensor, flags: torch.Tensor, output: torch.Tensor,
challenges/medium/70_segmented_prefix_sum/challenge.py:15
Methodreference_impl
( self, X: torch.Tensor, y: torch.Tensor, beta: torch.Tensor, n_samples: int, n_features: int )
challenges/medium/33_ordinary_least_squares/challenge.py:15
Methodreference_impl
( self, A: torch.Tensor, x: torch.Tensor, y: torch.Tensor, M: int, N: int, nnz: int )
challenges/medium/18_sparse_matrix_vector_multiplication/challenge.py:15
← previousnext →401–500 of 919, ranked by callers