Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions challenges/easy/52_silu/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def get_solve_signature(self) -> Dict[str, tuple]:

def generate_example_test(self) -> Dict[str, Any]:
dtype = torch.float32
N = 4
input = torch.tensor([1.0, 2.0, 3.0, 4.0], device=self.device, dtype=dtype)
N = 3
input = torch.tensor([0.5, 1.0, -0.5], device=self.device, dtype=dtype)
output = torch.empty(N, device=self.device, dtype=dtype)
return {
"input": input,
Expand Down
2 changes: 1 addition & 1 deletion challenges/hard/14_multi_agent_sim/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def generate_example_test(self) -> Dict[str, Any]:
dtype = torch.float32
N = 2
agents = torch.tensor(
[0.0, 0.0, 1.0, 0.0, 5.0, 0.0, 0.0, 1.0], device=self.device, dtype=dtype
[0.0, 0.0, 1.0, 0.0, 3.0, 4.0, 0.0, -1.0], device=self.device, dtype=dtype
)
agents_next = torch.empty(4 * N, device=self.device, dtype=dtype)
return {
Expand Down
2 changes: 1 addition & 1 deletion challenges/medium/40_batch_normalization/challenge.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h2>Example 1:</h2>
gamma = [1.0, 1.0]
beta = [0.0, 0.0]
eps = 1e-5
Output: output = [[-1.224, -1.224], [0.0, 0.0], [1.224, 1.224]]
Output: output = [[-1.225, -1.225], [0.0, 0.0], [1.225, 1.225]]
</pre>

<h2>Example 2:</h2>
Expand Down
2 changes: 1 addition & 1 deletion challenges/medium/5_softmax/challenge.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h2>Implementation Requirements</h2>
<h2>Example 1:</h2 >
<pre>
Input: [1.0, 2.0, 3.0], N = 3
Output: [0.090, 0.244, 0.665] (approximately)
Output: [0.090, 0.245, 0.665] (approximately)
</pre>

<h2>Example 2:</h2 >
Expand Down
16 changes: 11 additions & 5 deletions challenges/medium/61_rope_embedding/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,19 @@ def _half_split(self, table: torch.Tensor) -> torch.Tensor:
return table

def generate_example_test(self) -> Dict[str, Any]:
M = 1024
D = 64
M = 2
D = 4
dtype = torch.float32

Q = torch.randn(M, D, device=self.device, dtype=dtype)
Cos = self._half_split(torch.randn(M, D, device=self.device, dtype=dtype))
Sin = self._half_split(torch.randn(M, D, device=self.device, dtype=dtype))
Q = torch.tensor(
[[1.0, 2.0, 3.0, 4.0], [1.0, 1.0, 1.0, 1.0]], device=self.device, dtype=dtype
)
Cos = torch.tensor(
[[1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]], device=self.device, dtype=dtype
)
Sin = torch.tensor(
[[0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]], device=self.device, dtype=dtype
)
Output = torch.zeros(M, D, device=self.device, dtype=dtype)

return {
Expand Down
20 changes: 13 additions & 7 deletions challenges/medium/64_weight_dequantization/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,19 @@ def get_solve_signature(self) -> Dict[str, tuple]:
}

def generate_example_test(self) -> Dict[str, Any]:
M, N = 256, 256
TILE_SIZE = 128
X = torch.randn(M, N, device=self.device, dtype=torch.float32)
# S shape
s_rows = (M + TILE_SIZE - 1) // TILE_SIZE
s_cols = (N + TILE_SIZE - 1) // TILE_SIZE
S = torch.randn(s_rows, s_cols, device=self.device, dtype=torch.float32)
M, N = 4, 4
TILE_SIZE = 2
X = torch.tensor(
[
[10.0, 10.0, 5.0, 5.0],
[10.0, 10.0, 5.0, 5.0],
[2.0, 2.0, 8.0, 8.0],
[2.0, 2.0, 8.0, 8.0],
],
device=self.device,
dtype=torch.float32,
)
S = torch.tensor([[0.5, 2.0], [4.0, 0.25]], device=self.device, dtype=torch.float32)
Y = torch.empty_like(X)

return {
Expand Down
Loading