Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend int dtype with uint8 to skip lowering uint8-input ops in AIT splitter #989

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fx2ait/fx2ait/ait_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def create_ait_operator_support(
else [
ops.OpSupports.decline_if_input_dtype(torch.int64),
ops.OpSupports.decline_if_input_dtype(torch.int32),
ops.OpSupports.decline_if_input_dtype(torch.uint8),
]
)
chained_not_supported_ops += [
Expand Down
17 changes: 17 additions & 0 deletions fx2ait/fx2ait/test/test_ait_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,23 @@ def forward(self, a):
{"_run_on_gpu_0"},
)

# nodes w/ uint8 input should not be lowered
mod = acc_tracer.trace(test_mod, [x])
splitter = AITSplitter(
mod,
(x.to(torch.uint8).cuda(),),
operator_support,
settings,
)

split_results_int = splitter.generate_split_results()

self.assertTrue(len(split_results_int), 1)
self.assertEqual(
dict(split_results_int.split_module.named_children()).keys(),
{"_run_on_gpu_0"},
)

# nodes w/ integer input should be lowered
mod = acc_tracer.trace(test_mod, [x])
settings.allow_int_inputs = True
Expand Down
Loading