From fc580b4c9c295652d4a4c6cadee6834cd65dc1d4 Mon Sep 17 00:00:00 2001 From: Kunal Mansukhani Date: Thu, 1 Oct 2026 18:02:21 -0700 Subject: [PATCH 1/5] 53_casual_attention: shrink perf test input range to [-1, 1] Updated the range for generating Q, K, and V tensors in performance test. --- challenges/hard/53_casual_attention/challenge.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/challenges/hard/53_casual_attention/challenge.py b/challenges/hard/53_casual_attention/challenge.py index af087d0f..08929ab0 100644 --- a/challenges/hard/53_casual_attention/challenge.py +++ b/challenges/hard/53_casual_attention/challenge.py @@ -141,9 +141,9 @@ def generate_functional_test(self) -> List[Dict[str, Any]]: def generate_performance_test(self) -> Dict[str, Any]: M, d = 5000, 128 return { - "Q": RandTensor((M, d), -100.0, 100.0), - "K": RandTensor((M, d), -100.0, 100.0), - "V": RandTensor((M, d), -100.0, 100.0), + "Q": RandTensor((M, d), -1.0, 1.0), + "K": RandTensor((M, d), -1.0, 1.0), + "V": RandTensor((M, d), -1.0, 1.0), "output": OutTensor((M, d)), "M": M, "d": d, From 0a10da1ff49cf25ee4a68875d03aa2e37b12256f Mon Sep 17 00:00:00 2001 From: Kunal Mansukhani Date: Thu, 1 Oct 2026 18:04:09 -0700 Subject: [PATCH 2/5] 53_casual_attention: fix indentation of perf test inputs --- challenges/hard/53_casual_attention/challenge.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/challenges/hard/53_casual_attention/challenge.py b/challenges/hard/53_casual_attention/challenge.py index 08929ab0..5689cbeb 100644 --- a/challenges/hard/53_casual_attention/challenge.py +++ b/challenges/hard/53_casual_attention/challenge.py @@ -141,10 +141,10 @@ def generate_functional_test(self) -> List[Dict[str, Any]]: def generate_performance_test(self) -> Dict[str, Any]: M, d = 5000, 128 return { - "Q": RandTensor((M, d), -1.0, 1.0), - "K": RandTensor((M, d), -1.0, 1.0), - "V": RandTensor((M, d), -1.0, 1.0), - "output": OutTensor((M, d)), + "Q": RandTensor((M, d), -1.0, 1.0), + "K": RandTensor((M, d), -1.0, 1.0), + "V": RandTensor((M, d), -1.0, 1.0), + "output": OutTensor((M, d)), "M": M, "d": d, } From ea67daaa52d8f1827fd8b27746b5fa66be91b2c0 Mon Sep 17 00:00:00 2001 From: Kunal Mansukhani Date: Thu, 1 Oct 2026 18:08:24 -0700 Subject: [PATCH 3/5] 53_casual_attention: fix indentation of output line --- challenges/hard/53_casual_attention/challenge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/hard/53_casual_attention/challenge.py b/challenges/hard/53_casual_attention/challenge.py index 5689cbeb..ff49089d 100644 --- a/challenges/hard/53_casual_attention/challenge.py +++ b/challenges/hard/53_casual_attention/challenge.py @@ -144,7 +144,7 @@ def generate_performance_test(self) -> Dict[str, Any]: "Q": RandTensor((M, d), -1.0, 1.0), "K": RandTensor((M, d), -1.0, 1.0), "V": RandTensor((M, d), -1.0, 1.0), - "output": OutTensor((M, d)), + "output": OutTensor((M, d)), "M": M, "d": d, } From a8dd5ee486a3368981464d8b1e704009cd61b467 Mon Sep 17 00:00:00 2001 From: Kunal Mansukhani Date: Thu, 1 Oct 2026 18:09:41 -0700 Subject: [PATCH 4/5] 53_casual_attention: fix indentation of output line (again) --- challenges/hard/53_casual_attention/challenge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/hard/53_casual_attention/challenge.py b/challenges/hard/53_casual_attention/challenge.py index ff49089d..2def7986 100644 --- a/challenges/hard/53_casual_attention/challenge.py +++ b/challenges/hard/53_casual_attention/challenge.py @@ -144,7 +144,7 @@ def generate_performance_test(self) -> Dict[str, Any]: "Q": RandTensor((M, d), -1.0, 1.0), "K": RandTensor((M, d), -1.0, 1.0), "V": RandTensor((M, d), -1.0, 1.0), - "output": OutTensor((M, d)), + "output": OutTensor((M, d)), "M": M, "d": d, } From 178a69b89ad16a3a579f7f0343d2b95d45b98b13 Mon Sep 17 00:00:00 2001 From: Kunal Mansukhani Date: Thu, 1 Oct 2026 18:11:36 -0700 Subject: [PATCH 5/5] 53_casual_attention: update constraint to [-1, 1] --- challenges/hard/53_casual_attention/challenge.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/hard/53_casual_attention/challenge.html b/challenges/hard/53_casual_attention/challenge.html index 1558f9d6..4a7d9a90 100644 --- a/challenges/hard/53_casual_attention/challenge.html +++ b/challenges/hard/53_casual_attention/challenge.html @@ -249,7 +249,7 @@

Constraints

  • Matrix Q, K, and V are all of size M×d
  • 1 ≤ M ≤ 10000
  • 1 ≤ d ≤ 128
  • -
  • All elements in Q, K, and V are sampled from[-100.0, 100.0]
  • +
  • All elements in Q, K, and V are sampled from[-1.0, 1.0]
  • Data type for all matrices is float32
  • Performance is measured with M = 5,000