From a78657f5926f07e5eb5d207e7103a66980dc1990 Mon Sep 17 00:00:00 2001 From: Benson Ma Date: Tue, 4 Nov 2025 17:45:08 -0800 Subject: [PATCH] Fix test reliability with table order (#5087) Summary: X-link: https://github.com/facebookresearch/FBGEMM/pull/2097 - Fix test reliability with table order Differential Revision: D86242426 Pulled By: q10 --- .github/workflows/_fbgemm_gpu_cuda_test.yml | 3 +++ .../split_table_batched_embeddings_ops_training.py | 2 +- fbgemm_gpu/setup.py | 4 +--- fbgemm_gpu/test/tbe/utils/split_embeddings_test.py | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/_fbgemm_gpu_cuda_test.yml b/.github/workflows/_fbgemm_gpu_cuda_test.yml index 03d619cae0..692b6ab7ac 100644 --- a/.github/workflows/_fbgemm_gpu_cuda_test.yml +++ b/.github/workflows/_fbgemm_gpu_cuda_test.yml @@ -132,6 +132,9 @@ jobs: # clang-16: error: unknown argument: '-fno-tree-loop-vectorize' run: . $PRELUDE; install_cxx_compiler $BUILD_ENV gcc + - name: Install Build Tools + run: . $PRELUDE; install_build_tools $BUILD_ENV + - name: Install CUDA run: . $PRELUDE; install_cuda $BUILD_ENV ${{ matrix.cuda-version }} diff --git a/fbgemm_gpu/fbgemm_gpu/split_table_batched_embeddings_ops_training.py b/fbgemm_gpu/fbgemm_gpu/split_table_batched_embeddings_ops_training.py index 2acff12edf..0a2a7ab0a1 100644 --- a/fbgemm_gpu/fbgemm_gpu/split_table_batched_embeddings_ops_training.py +++ b/fbgemm_gpu/fbgemm_gpu/split_table_batched_embeddings_ops_training.py @@ -1560,7 +1560,7 @@ def get_table_name_for_logging(table_names: Optional[list[str]]) -> str: return "" # Do this because sometimes multiple shards of the same table could appear # in one TBE. - table_name_set = set(table_names) + table_name_set = sorted(set(table_names)) if len(table_name_set) == 1: return next(iter(table_name_set)) return f"<{len(table_name_set)} tables>: {table_name_set}" diff --git a/fbgemm_gpu/setup.py b/fbgemm_gpu/setup.py index 97600fc0bb..dd3246539a 100644 --- a/fbgemm_gpu/setup.py +++ b/fbgemm_gpu/setup.py @@ -4,8 +4,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# @licenselint-loose-mode - import argparse import logging import os @@ -655,7 +653,7 @@ def main(argv: list[str]) -> None: ] + [ f"Programming Language :: Python :: {x}" - for x in ["3", "3.9", "3.10", "3.11", "3.12", "3.13"] + for x in ["3", "3.10", "3.11", "3.12", "3.13"] ], ) diff --git a/fbgemm_gpu/test/tbe/utils/split_embeddings_test.py b/fbgemm_gpu/test/tbe/utils/split_embeddings_test.py index b6864a3ac1..1ebdaddaa5 100644 --- a/fbgemm_gpu/test/tbe/utils/split_embeddings_test.py +++ b/fbgemm_gpu/test/tbe/utils/split_embeddings_test.py @@ -178,17 +178,17 @@ def test_get_table_name_for_logging(self) -> None: SplitTableBatchedEmbeddingBagsCodegen.get_table_name_for_logging( ["t1", "t2"] ), - "<2 tables>: {'t1', 't2'}", + "<2 tables>: ['t1', 't2']", ) self.assertEqual( SplitTableBatchedEmbeddingBagsCodegen.get_table_name_for_logging( ["t1", "t2", "t1"] ), - "<2 tables>: {'t1', 't2'}", + "<2 tables>: ['t1', 't2']", ) self.assertEqual( SplitTableBatchedEmbeddingBagsCodegen.get_table_name_for_logging([]), - "<0 tables>: set()", + "<0 tables>: []", ) @unittest.skipIf(*gpu_unavailable)