Skip to content

Add srcB separate format from srcA to test infra.#1288

Open
uvelimirovicTT wants to merge 7 commits intomainfrom
uvelimirovic/add_second_data_format_test_infra
Open

Add srcB separate format from srcA to test infra.#1288
uvelimirovicTT wants to merge 7 commits intomainfrom
uvelimirovic/add_second_data_format_test_infra

Conversation

@uvelimirovicTT
Copy link
Contributor

@uvelimirovicTT uvelimirovicTT commented Feb 12, 2026

Problem description

  • LLK cpp api supports separate data formats for src registers (unpack_out). However, test infrastructure supported only one input data format which was used for both src_A and src_B.

What's changed

  • Refactored every test to use unpack_A_src, unpack_B_src, unpack_A_dst and unpack_B_dst for unpack configuration and execution instead of just using general unpack_src and unpack_dst for everything in unpack.

Type of change

  • New feature (non-breaking change which adds functionality)

Heads up!

  • Since we are introducing a second data format in input, there had to be made a few changes in data inference in python test infra. The changes were done with the most logical approach I could come up with at the moment since there are a few edge cases for data inference.

@github-actions
Copy link
Contributor

Thank you for your contribution! 🚀
If you want to run metal post-commit tests, you can add the metal-post-commit-tests label to this pull request.
📖 For more information, please refer to our CONTRIBUTING guide.

@github-actions github-actions bot added performance test-infra This label is used for issues, pull requests, or tasks related to the LLK testing framework labels Feb 12, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the LLK test infrastructure to support configuring separate data formats for src_A vs src_B (unpack_out), aligning tests and Python format-inference/header generation with the LLK C++ API capabilities.

Changes:

  • Extend format configuration plumbing to carry distinct A/B input+output unpack formats through generated headers and FormatConfig.
  • Update many C++ test kernels/perf kernels to call _llk_unpack_hw_configure_ with unpack_A_* and unpack_B_* instead of a single unpack_*.
  • Update Python test infra and at least one Python test to exercise different formats for src_A vs src_B.

Reviewed changes

Copilot reviewed 48 out of 48 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/sources/unpack_untilize_test.cpp Switch unpack hw configure/init to A/B-aware format fields.
tests/sources/unpack_untilize_perf.cpp Switch unpack hw configure/init to A/B-aware format fields.
tests/sources/unpack_transpose_perf.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/unpack_tilize_test.cpp Use A/B-aware formats for tilize init/execute.
tests/sources/unpack_tilize_sweep_test.cpp Use A/B-aware formats for tilize init/execute.
tests/sources/unpack_tilize_perf.cpp Use A/B-aware formats for tilize init/execute.
tests/sources/unpack_matmul_test.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/unpack_a_bcast_eltwise_test.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/unpack_a_bcast_eltwise_perf.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/unpack_A_test.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/transpose_dest_test.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/tilize_calculate_untilize_L1.cpp Use A/B-aware formats for fused L1-to-L1 tilize passes.
tests/sources/sfpu_reduce_test.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/sfpu_reduce_sdpa_test.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/sfpu_reduce_sdpa_perf.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/sfpu_binary_test.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/reduce_test.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/reduce_perf.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/pack_untilize_test.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/pack_untilize_perf.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/pack_test.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/pack_rows_test.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/pack_dest_bank_test.cpp Use A/B-aware formats and modernize integer types.
tests/sources/pack_dest_bank_perf.cpp Use A/B-aware formats and modernize integer types.
tests/sources/multiple_tiles_eltwise_test.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/matmul_unpack_tilize_test.cpp Use A/B-aware formats for tilize and reconfig paths.
tests/sources/matmul_test.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/matmul_perf.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/matmul_pack_untilize_test.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/matmul_and_unary_sfpu_test.cpp Switch unpack hw configure/reconfig to A/B-aware format fields.
tests/sources/math_transpose_perf.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/math_matmul_test.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/fast_tilize_test.cpp Switch unpack hw configure/init and block calls to A-aware formats.
tests/sources/eltwise_unary_sfpu_test.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/eltwise_unary_sfpu_perf.cpp Use A/B-aware formats for HW config and unpack-A ops.
tests/sources/eltwise_unary_datacopy_test.cpp Use A/B-aware formats for HW config/tilize path and unpack-A ops.
tests/sources/eltwise_binary_transpose_bcast_test.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/eltwise_binary_test.cpp Switch unpack hw configure to A/B-aware format fields.
tests/sources/eltwise_binary_sfpu_perf.cpp Use A/B-aware formats for HW config and unpack-A init/ops.
tests/sources/eltwise_binary_fpu_perf.cpp Update unpack hw configure to A/B-aware format fields (but has a naming bug).
tests/python_tests/test_eltwise_binary.py Exercise different src_A vs src_B input formats via InputOutputFormat.
tests/python_tests/helpers/test_config.py Accept InputOutputFormat and plumb input_format_B into inference/header generation.
tests/python_tests/helpers/stimuli_config.py Update stimuli header address sizing for separate A/B formats (but needs compatibility fixes).
tests/python_tests/helpers/fuser_config.py Update outlier check call signature to include src_B (currently none).
tests/python_tests/helpers/format_config.py Introduce InputOutputFormat with optional B input format (but has duplicate __str__/__repr__).
tests/python_tests/helpers/data_format_inference.py Extend inference logic to handle separate A/B inputs and derive math/pack formats accordingly.
tests/helpers/include/params.h Construct FormatConfig with explicit UNPACK_A/B IN/OUT values.
tests/helpers/include/data_format_inference.h Expand FormatConfig to hold separate A/B unpack formats and update helper builder.
Comments suppressed due to low confidence (1)

tests/python_tests/helpers/format_config.py:308

  • InputOutputFormat defines __str__/__repr__ twice. The later definitions overwrite the earlier ones, so the string representation will not include the new input_B detail and the duplicates make the class harder to maintain. Please remove the duplicate methods and keep a single __str__/__repr__ implementation (ideally the one that includes A/B/out).
    def __str__(self):
        return f"InputOutputFormat[A:{self.input},B:{self.input_B},out:{self.output}]"

    def __repr__(self) -> str:
        return self.__str__()

    def __str__(self):
        return f"InputOutputFormat[{self.input},{self.output}]"

    def __repr__(self) -> str:
        return self.__str__()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@uvelimirovicTT uvelimirovicTT force-pushed the uvelimirovic/add_second_data_format_test_infra branch from 4008430 to 411bbc4 Compare February 12, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance quasar test-infra This label is used for issues, pull requests, or tasks related to the LLK testing framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant