mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
fix tests caused by has_triton (#161737)
Summary: this will only cause it in the event that we are serializing a triton hop. there are a few tests that do weird mocking stuff that this function doesn't like, so this will prevent it from being called there. Test Plan: att Rollback Plan: Differential Revision: D81261486 Pull Request resolved: https://github.com/pytorch/pytorch/pull/161737 Approved by: https://github.com/angelayi
This commit is contained in:
parent
5cb1d71e59
commit
c1cb1cb26e
|
|
@ -94,14 +94,6 @@ from .schema import ( # type: ignore[attr-defined]
|
|||
from .union import _Union
|
||||
|
||||
|
||||
if has_triton():
|
||||
from triton.runtime.autotuner import Autotuner
|
||||
else:
|
||||
|
||||
class Autotuner: # type: ignore[no-redef]
|
||||
pass
|
||||
|
||||
|
||||
__all__ = [
|
||||
"serialize",
|
||||
"GraphModuleSerializer",
|
||||
|
|
@ -684,6 +676,7 @@ class GraphModuleSerializer(metaclass=Final):
|
|||
is torch._higher_order_ops.triton_kernel_wrap.triton_kernel_wrapper_functional
|
||||
):
|
||||
assert has_triton(), "triton required to serialize triton kernels"
|
||||
from triton.runtime.autotuner import Autotuner
|
||||
|
||||
meta_val = node.meta["val"]
|
||||
assert isinstance(meta_val, dict)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user