Skip to content

Commit 39638ea

Browse files
committed
avoid torch.dtype being translated to thunder.core.dtypes.dtype
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
1 parent 2b906bb commit 39638ea

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

thunder/tests/test_grad.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,11 @@ def test_vjp_correctness(op, device, dtype, executor, comp):
406406
# sample.thunder() line below attempts to approximate those conversions
407407
# for non-differentiable arguments like dtypes so that the test will
408408
# execute properly.
409-
sample = sample.thunder() # converts torch.dtype to thunder.dtype
409+
# NOTE: While `convert_element_type` is skipeed as of https://github.com/Lightning-AI/lightning-thunder/pull/2213
410+
# as in https://github.com/Lightning-AI/lightning-thunder/blob/dbf6bad3/thunder/tests/opinfos.py#L3324-L3346,
411+
# `torch.Tensor.view(dtype)` seems to require `torch.dtype` to be kept as is, opposite to `convert_element_type`.
412+
if op.name != "view":
413+
sample = sample.thunder() # converts torch.dtype to thunder.dtype
410414
sample = sample.remove_singularities(op, eps)
411415

412416
flat_op, flat_args, spec = flatten_func(op.op, sample.args, sample.kwargs)

0 commit comments

Comments
 (0)