Skip to content

Commit 789dd31

Browse files
xuzhao9facebook-github-bot
authored andcommitted
Fix a few operators on AMD
Summary: Need to make a few changes to enable more operators on AMD: 1. use `HAS_LIGER_KERNEL` to enable liger layer_norm on demand 2. fix a bug when running with `--isolate`. `--isolate` will run each operator in subprocess, to avoid interference between operators. 3. we need to explicitly add some dependencies on AMD Reviewed By: adamomainz Differential Revision: D65450899 fbshipit-source-id: 9cd1406123b0d2a5fbddf15f4a711e88bbd977d6
1 parent 6ae2eba commit 789dd31

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

test/test_gpu/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def check_ci_output(op):
3939

4040
output = op.output
4141
output_impls = output.result[0][1].keys()
42-
skiped_impls = op.tb_args.skip
42+
skiped_impls = op.tb_args.skip if op.tb_args.skip else []
4343
ci_enabled_impls = [
4444
x for x in REGISTERED_BENCHMARKS[output.op_name].keys() if x not in skiped_impls
4545
]

tritonbench/operators/layer_norm/operator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def inner(*args):
3939

4040
return lambda: inner(*args)
4141

42-
@register_benchmark()
42+
@register_benchmark(enabled=HAS_LIGER_KERNEL)
4343
def liger_layer_norm(self, *args):
4444
(x, w_shape, weight, bias, eps) = args
4545
return lambda: LigerLayerNormFunction.apply(x, weight, bias, eps)

tritonbench/utils/parser.py

+2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ def _find_param_loc(params, key: str) -> int:
190190
def _remove_params(params, loc):
191191
if loc == -1:
192192
return params
193+
if params[loc + 1].startswith("--"):
194+
return params[:loc] + params[loc + 1 :]
193195
return params[:loc] + params[loc + 2 :]
194196

195197

0 commit comments

Comments
 (0)