Skip to content

Commit 6df7516

Browse files
authored
Strip extra newlines from *.expected files (#255)
1 parent 7c64ae1 commit 6df7516

13 files changed

+2
-12
lines changed

helion/_testing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ def save(self) -> None:
209209
f"--- assertExpectedJournal({name})\n{expected}\n\n"
210210
for expected in expected_values
211211
)
212+
# Remove the last newline to play nicer with some people's editors
213+
f.truncate(f.tell() - 1)
212214
os.rename(tmp, self.filename)
213215

214216
@staticmethod

test/test_associative_scan.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1648,4 +1648,3 @@ def _test_cumsum_reverse_kernel_make_precompiler(x: torch.Tensor):
16481648
_RDIM_SIZE_1 = triton.next_power_of_2(x.size(1))
16491649
from helion.runtime.precompile_shim import make_precompiler
16501650
return make_precompiler(_test_cumsum_reverse_kernel_kernel)(x, result, x.size(1), result.stride(1), x.stride(1), _RDIM_SIZE_1, num_warps=4, num_stages=3)
1651-

test/test_atomic_add.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,3 @@ def _atomic_add_overlap_kernel_make_precompiler(x: torch.Tensor, y: torch.Tensor
147147
_BLOCK_SIZE_0 = 32
148148
from helion.runtime.precompile_shim import make_precompiler
149149
return make_precompiler(_atomic_add_overlap_kernel_kernel)(indices, y, x, _BLOCK_SIZE_0, num_warps=4, num_stages=3)
150-

test/test_broadcasting.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,3 @@ def _fn_make_precompiler(a, b):
295295
_BLOCK_SIZE_1 = 16
296296
from helion.runtime.precompile_shim import make_precompiler
297297
return make_precompiler(_fn_kernel)(a, b, out, a.size(0), a.size(1), a.stride(0), a.stride(1), b.stride(0), out.stride(0), out.stride(1), _BLOCK_SIZE_0, _BLOCK_SIZE_1, num_warps=4, num_stages=3)
298-

test/test_closures.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,3 @@ def _call_func_arg_on_host_make_precompiler(a, alloc):
205205
_BLOCK_SIZE_0 = 512
206206
from helion.runtime.precompile_shim import make_precompiler
207207
return make_precompiler(_call_func_arg_on_host_kernel)(a, out, a.size(0), a.stride(0), out.stride(0), _BLOCK_SIZE_0, num_warps=4, num_stages=3)
208-

test/test_constexpr.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,3 @@ def _fn_make_precompiler(x: torch.Tensor, s: hl.constexpr):
116116
_BLOCK_SIZE_1 = 16
117117
from helion.runtime.precompile_shim import make_precompiler
118118
return make_precompiler(_fn_kernel)(x, out, out.stride(0), out.stride(1), x.stride(0), b, _BLOCK_SIZE_0, _BLOCK_SIZE_1, num_warps=4, num_stages=3)
119-

test/test_control_flow.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,3 @@ def _fn_make_precompiler(x: torch.Tensor, y: torch.Tensor):
214214
output = torch.zeros_like(x)
215215
from helion.runtime.precompile_shim import make_precompiler
216216
return make_precompiler(_fn_kernel)(x, y, output, output.stride(0), x.stride(0), y.stride(0), num_warps=4, num_stages=3)
217-

test/test_generate_ast.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,4 +548,3 @@ def _torch_ops_pointwise_make_precompiler(x, y):
548548
_BLOCK_SIZE_0 = 128
549549
from helion.runtime.precompile_shim import make_precompiler
550550
return make_precompiler(_torch_ops_pointwise_kernel)(x, y, out, x.size(0), out.stride(0), x.stride(0), y.stride(0), _BLOCK_SIZE_0, num_warps=4, num_stages=3)
551-

test/test_indexing.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,3 @@ def _pairwise_add_make_precompiler(x: torch.Tensor):
171171
_BLOCK_SIZE_0 = 32
172172
from helion.runtime.precompile_shim import make_precompiler
173173
return make_precompiler(_pairwise_add_kernel)(out, x, out.size(0), out.stride(0), x.stride(0), _BLOCK_SIZE_0, num_warps=4, num_stages=3)
174-

test/test_reduce.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,4 +590,3 @@ def _test_reduce_keep_dims_kernel_make_precompiler(x: torch.Tensor):
590590
_RDIM_SIZE_1 = triton.next_power_of_2(x.size(1))
591591
from helion.runtime.precompile_shim import make_precompiler
592592
return make_precompiler(_test_reduce_keep_dims_kernel_kernel)(x, result, x.size(0), x.size(1), result.stride(0), x.stride(0), x.stride(1), _BLOCK_SIZE_0, _RDIM_SIZE_1, num_warps=4, num_stages=3)
593-

0 commit comments

Comments
 (0)