Skip to content

Commit

Permalink
Enable fast math by default. (#108)
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Enkovich <[email protected]>
  • Loading branch information
ienkovich authored Aug 9, 2024
1 parent 9c10308 commit 9035f4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third_party/cpu/backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CPUOptions:
allow_fp8e4b15: bool = True
enable_fp_fusion: bool = True
max_num_imprecise_acc_default: int = 0
enable_fast_math: bool = False
enable_fast_math: bool = True

# TODO: We may introduce CPU-specific options like # of cores.

Expand Down Expand Up @@ -58,7 +58,7 @@ def __init__(self, target: tuple) -> None:
def parse_options(self, opts) -> Any:
args = {k: opts[k] for k in CPUOptions.__dataclass_fields__.keys() if k in opts}
if not "enable_fast_math" in args:
args["enable_fast_math"] = os.getenv("TRITON_CPU_FAST_MATH", "0") == "1"
args["enable_fast_math"] = os.getenv("TRITON_CPU_FAST_MATH", "1") != "0"
return CPUOptions(**args)

def pack_metadata(self, metadata):
Expand Down

0 comments on commit 9035f4b

Please sign in to comment.