Skip to content

Commit 9398f66

Browse files
committed
fix code format problems
1 parent 2059fe0 commit 9398f66

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

python/triton/compiler/code_generator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# ideally we wouldn't need any runtime component
1717
from ..runtime import JITFunction
1818
from .._utils import find_paths_if, get_iterable_path, set_iterable_path
19+
from .hint_manager import hint_trigger
1920

2021
from .errors import (CompilationError, CompileTimeAssertionFailure, UnsupportedLanguageConstruct)
2122

python/triton/runtime/jit.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
from ..runtime.driver import driver
1313
from types import ModuleType
1414
from .._utils import find_paths_if, get_iterable_path
15-
import tokenize
16-
from io import StringIO
1715

1816
TRITON_MODULE = __name__[:-len(".runtime.jit")]
1917

@@ -705,6 +703,7 @@ def preload(self, specialization_data):
705703
# the user might want to monkey-patch self.src dynamically.
706704
# Our unit tests do this, for example.
707705
def parse(self):
706+
from ..compiler.hint_manager import hint_trigger
708707
# Maps line numbers to comment hints
709708
line_flagtree_hints = hint_trigger("maps_line_numbers_to_comment_hints", self)
710709
if line_flagtree_hints is None:

third_party/aipu/backend/aipu_hint_handler.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ def get_node_hints(code_generator, node):
2121
@staticmethod
2222
def inject_kwargs_with_hints(fn, flagtree_hints, line_num, kws):
2323
if fn.__name__ == "load" and flagtree_hints is not None:
24-
print(f"[FLAGTREE] tl.load at line {line_num} has annotation {flagtree_hints}")
25-
if 'flagtree_hints' not in kws:
26-
kws['flagtree_hints'] = ""
27-
if flagtree_hints not in kws['flagtree_hints']:
28-
kws['flagtree_hints'] = flagtree_hints
24+
print(f"[FLAGTREE] tl.load at line {line_num} has annotation {flagtree_hints}")
25+
if 'flagtree_hints' not in kws:
26+
kws['flagtree_hints'] = ""
27+
if flagtree_hints not in kws['flagtree_hints']:
28+
kws['flagtree_hints'] = flagtree_hints
2929

3030
@staticmethod
3131
def maps_line_numbers_to_comment_hints(jit_fn):
@@ -49,4 +49,4 @@ def maps_line_numbers_to_comment_hints(jit_fn):
4949
@staticmethod
5050
def attach_line_number_to_comment_mapping(tree, line_flagtree_hints):
5151
if tree.body:
52-
tree.body[0].line_flagtree_hints = line_flagtree_hints
52+
tree.body[0].line_flagtree_hints = line_flagtree_hints

0 commit comments

Comments
 (0)