From 31e005d9e32bac5cd8f6f9e754c51365a337fa6d Mon Sep 17 00:00:00 2001 From: "Kevin H. Luu" Date: Mon, 30 Sep 2024 20:33:12 -0700 Subject: [PATCH] [CI/Build] Fix machete generated kernel files ordering (#8976) Signed-off-by: kevin Co-authored-by: Cody Yu Signed-off-by: Amit Garg --- csrc/quantization/machete/generate.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/csrc/quantization/machete/generate.py b/csrc/quantization/machete/generate.py index 8ed81ea727aa3..c35dfe94c9c41 100644 --- a/csrc/quantization/machete/generate.py +++ b/csrc/quantization/machete/generate.py @@ -457,7 +457,13 @@ def generate(): )), ] - schedules = list(set([x[1] for x in default_heuristic])) + # Do not use schedules = list(set(...)) because we need to make sure + # the output list is deterministic; otherwise the generated kernel file + # will be non-deterministic and causes ccache miss. + schedules = [] + for _, schedule_config in default_heuristic: + if schedule_config not in schedules: + schedules.append(schedule_config) impl_configs = []