From 234210b1d8df81493fc46c41e1d2820befc85aaf Mon Sep 17 00:00:00 2001 From: Cindy Jiang <47068112+cindyyuanjiang@users.noreply.github.com> Date: Thu, 7 Dec 2023 16:00:07 -0800 Subject: [PATCH] [FEA] User tool should pass `--platform` option/argument to Profiling tool (#679) * pas platform option and arg to profiling core tool Signed-off-by: cindyyuanjiang * refactored code Signed-off-by: cindyyuanjiang * fixed confusing var naming Signed-off-by: cindyyuanjiang --------- Signed-off-by: cindyyuanjiang --- user_tools/src/spark_rapids_pytools/rapids/profiling.py | 2 +- user_tools/src/spark_rapids_pytools/rapids/qualification.py | 4 ---- user_tools/src/spark_rapids_pytools/rapids/rapids_tool.py | 3 ++- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/user_tools/src/spark_rapids_pytools/rapids/profiling.py b/user_tools/src/spark_rapids_pytools/rapids/profiling.py index 0c6e1cfcc..2c31af406 100644 --- a/user_tools/src/spark_rapids_pytools/rapids/profiling.py +++ b/user_tools/src/spark_rapids_pytools/rapids/profiling.py @@ -247,7 +247,7 @@ def _process_output(self): self.__generate_report_with_recommendations() def _init_rapids_arg_list(self) -> List[str]: - return self._create_autotuner_rapids_args() + return super()._init_rapids_arg_list() + self._create_autotuner_rapids_args() @dataclass diff --git a/user_tools/src/spark_rapids_pytools/rapids/qualification.py b/user_tools/src/spark_rapids_pytools/rapids/qualification.py index 7b5ed96b1..7ed1d3cff 100644 --- a/user_tools/src/spark_rapids_pytools/rapids/qualification.py +++ b/user_tools/src/spark_rapids_pytools/rapids/qualification.py @@ -770,10 +770,6 @@ def _write_summary(self): if wrapper_out_content is not None: print(Utils.gen_multiline_str(wrapper_out_content)) - def _init_rapids_arg_list(self) -> List[str]: - # TODO: Make sure we add this argument only for jar versions 23.02+ - return ['--platform', self.ctxt.platform.get_platform_name().replace('_', '-')] - def _generate_section_lines(self, sec_conf: dict) -> List[str]: # TODO: we may like to show the scripts even when the gpu-cluster is not defined # this requires that we allow to generate the script without the gpu-cluster diff --git a/user_tools/src/spark_rapids_pytools/rapids/rapids_tool.py b/user_tools/src/spark_rapids_pytools/rapids/rapids_tool.py index 7fbbd9b09..41214f65c 100644 --- a/user_tools/src/spark_rapids_pytools/rapids/rapids_tool.py +++ b/user_tools/src/spark_rapids_pytools/rapids/rapids_tool.py @@ -756,7 +756,8 @@ def _process_local_job_submission_args(self): self.ctxt.update_job_args(job_args) def _init_rapids_arg_list(self) -> List[str]: - return [] + # TODO: Make sure we add this argument only for jar versions 23.02+ + return ['--platform', self.ctxt.platform.get_platform_name().replace('_', '-')] @timeit('Building Job Arguments and Executing Job CMD') # pylint: disable=too-many-function-args def _prepare_local_job_arguments(self):