Skip to content

Conversation

@vvukomanovicTT
Copy link
Contributor

Ticket

Github issue

Problem description

Majority of initis in the LLK are missing unints and leaving HW in random state for the next operation.

What's changed

Second PR which implements missing BH unints. This is the second out of 3 PRs (third is for Quasar).

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

@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.

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

This PR adds missing uninitialization functions for Blackhole architecture's Low-Level Kernel (LLK) library. The PR is part of a series (second of three) addressing issue #33825, which identifies that most init functions in the LLK leave hardware in an undefined state without corresponding cleanup. These uninit functions restore hardware registers and counters to their default states after operations complete.

Key changes:

  • Added uninit functions to unpack operations (untilize, matmul, reduce, and generic A/AB unpacking) that restore address counters and configuration registers
  • Added empty uninit stubs for math operations that use only transient state
  • Added empty uninit stub for pack operations where default state matches initialized state

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tt_llk_blackhole/llk_lib/llk_unpack_untilize.h Adds uninit function with conditional logic to either restore from saved GPRs or reset to default values
tt_llk_blackhole/llk_lib/llk_unpack_AB_reduce_custom.h Updates uninit function to accept dimension parameters and restore untilizer state; includes commented code referencing fp32 accumulation requirements
tt_llk_blackhole/llk_lib/llk_unpack_AB_matmul.h Adds uninit function to reset unpacker A and B address counters to defaults
tt_llk_blackhole/llk_lib/llk_unpack_AB.h Adds uninit function to reset unpacker A and B address counters to defaults
tt_llk_blackhole/llk_lib/llk_unpack_A.h Adds templated uninit function to reset unpacker counter and debug feature register
tt_llk_blackhole/llk_lib/llk_pack.h Adds empty uninit stub noting pack_init already sets default state
tt_llk_blackhole/llk_lib/llk_math_welfords_sfpu.h Adds empty uninit stub for Welford's algorithm SFPU operations
tt_llk_blackhole/llk_lib/llk_math_transpose_dest.h Adds empty uninit stub for destination transpose operations
tt_llk_blackhole/llk_lib/llk_math_reduce_custom.h Adds empty uninit stub for custom block reduce operations
tt_llk_blackhole/llk_lib/llk_math_reduce.h Adds empty uninit stub for reduce operations
tt_llk_blackhole/llk_lib/llk_math_matmul.h Adds empty uninit stub for matrix multiplication operations
tt_llk_blackhole/llk_lib/llk_math_eltwise_unary_sfpu.h Adds empty uninit stub for unary SFPU element-wise operations
tt_llk_blackhole/llk_lib/llk_math_eltwise_unary_datacopy.h Adds empty uninit stub for unary datacopy operations
tt_llk_blackhole/llk_lib/llk_math_eltwise_ternary_sfpu.h Adds empty uninit stub for ternary SFPU element-wise operations
tt_llk_blackhole/llk_lib/llk_math_eltwise_binary_sfpu.h Adds empty uninit stub for binary SFPU element-wise operations
tt_llk_blackhole/llk_lib/llk_math_eltwise_binary.h Adds empty uninit stub for binary element-wise operations

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

@vvukomanovicTT vvukomanovicTT changed the title Add missing uninits for blackhole [skip uplift] Add missing uninits for blackhole Dec 30, 2025
@ncvetkovicTT ncvetkovicTT added the metal-post-commit-tests This label is used for running tt-metal post-commit tests: wormhole and blackhole label Dec 30, 2025
@github-actions
Copy link
Contributor

🚀 tt-metal post-commit tests

Branch: vvukomanovic/1225-bh-uninits
Test Configuration:

  • Wormhole tests: ⚪ Disabled
  • Blackhole tests: 🟢 Enabled

Test Results:

  • Wormhole tests: ⚪ Not run
  • C++ post-commit tests: 🎯 Passed - View run
  • Blackhole tests: 🎯 Passed - View run
  • Device perf regressions tests: 🎯 Passed - View run

🔗 Links

📊 Post-commit workflow: #20597970904

@github-actions github-actions bot added test-infra This label is used for issues, pull requests, or tasks related to the LLK testing framework wormhole labels Dec 31, 2025
@github-actions
Copy link
Contributor

🚀 tt-metal post-commit tests

Branch: vvukomanovic/1225-bh-uninits
Test Configuration:

  • Wormhole tests: ⚪ Disabled
  • Blackhole tests: 🟢 Enabled

Test Results:

🔗 Links

📊 Post-commit workflow: #20617860802

@github-actions
Copy link
Contributor

github-actions bot commented Dec 31, 2025

🚀 tt-metal post-commit tests

Branch: vvukomanovic/1225-bh-uninits
Test Configuration:

  • Wormhole tests: 🟢 Enabled
  • Blackhole tests: 🟢 Enabled

Test Results:

🔗 Links

📊 Post-commit workflow: #20619527396

@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2026

🚀 tt-metal post-commit tests

Branch: vvukomanovic/1225-bh-uninits
Test Configuration:

  • Wormhole tests: 🟢 Enabled
  • Blackhole tests: 🟢 Enabled

Test Results:

  • Wormhole tests: 🎯 Passed - View run
  • C++ post-commit tests: 🛑 Failed - View run
  • Blackhole tests: 🛑 Failed - View run
  • Device perf regressions tests: 🛑 Failed - View run

🔗 Links

📊 Post-commit workflow: #20624129974

@vvukomanovicTT vvukomanovicTT force-pushed the vvukomanovic/1225-bh-uninits branch from ea20f9a to cd0f11a Compare January 12, 2026 12:31
@ncvetkovicTT ncvetkovicTT added LLK and removed metal-post-commit-tests This label is used for running tt-metal post-commit tests: wormhole and blackhole test-infra This label is used for issues, pull requests, or tasks related to the LLK testing framework labels Jan 12, 2026
@github-actions github-actions bot added the test-infra This label is used for issues, pull requests, or tasks related to the LLK testing framework label Jan 12, 2026
@github-actions
Copy link
Contributor

🚀 tt-metal post-commit tests

Branch: vvukomanovic/1225-bh-uninits
Test Configuration:

  • Wormhole tests: 🟢 Enabled
  • Blackhole tests: 🟢 Enabled

Test Results:

  • Wormhole tests: 🚫 Workflow Cancelled - Check logs for details
  • C++ post-commit tests: 🚫 Workflow Cancelled - Check logs for details
  • Blackhole tests: 🚫 Workflow Cancelled - Check logs for details
  • Device perf regressions tests: 🚫 Workflow Cancelled - Check logs for details

🔗 Links

📊 Post-commit workflow: #20919444135

@vvukomanovicTT vvukomanovicTT added this pull request to the merge queue Jan 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 13, 2026
@vvukomanovicTT vvukomanovicTT added this pull request to the merge queue Jan 13, 2026
@fvranicTT fvranicTT removed this pull request from the merge queue due to a manual request Jan 13, 2026
@vvukomanovicTT vvukomanovicTT added this pull request to the merge queue Jan 14, 2026
Merged via the queue into main with commit f3fa1b4 Jan 14, 2026
48 of 50 checks passed
@vvukomanovicTT vvukomanovicTT deleted the vvukomanovic/1225-bh-uninits branch January 14, 2026 09:45
github-merge-queue bot pushed a commit to tenstorrent/tt-metal that referenced this pull request Jan 14, 2026
### Ticket
[Link to Github
Issue](#33825)
LLK PR: tenstorrent/tt-llk#1029
### Problem description
This PR uplifts LLK to the newest state of uninits and makes changes to
unints function which are needed due to the changes in the llk API .


### What's changed
LLK module hash. 
unpack_AB_reduce_unint explicitly sets unints args. 

### Checklist

- [ ] [![All post-commit
tests](https://github.com/tenstorrent/tt-metal/actions/workflows/all-post-commit-workflows.yaml/badge.svg?branch=vvukomanovic/0126-bh-unints-uplift)](https://github.com/tenstorrent/tt-metal/actions/workflows/all-post-commit-workflows.yaml?query=branch:vvukomanovic/0126-bh-unints-uplift)
- [ ] [![Blackhole Post
commit](https://github.com/tenstorrent/tt-metal/actions/workflows/blackhole-post-commit.yaml/badge.svg?branch=vvukomanovic/0126-bh-unints-uplift)](https://github.com/tenstorrent/tt-metal/actions/workflows/blackhole-post-commit.yaml?query=branch:vvukomanovic/0126-bh-unints-uplift)
- [ ]
[![cpp-unit-tests](https://github.com/tenstorrent/tt-metal/actions/workflows/tt-metal-l2-nightly.yaml/badge.svg?branch=vvukomanovic/0126-bh-unints-uplift)](https://github.com/tenstorrent/tt-metal/actions/workflows/tt-metal-l2-nightly.yaml?query=branch:vvukomanovic/0126-bh-unints-uplift)
- [ ] New/Existing tests provide coverage for changes


#### Model tests

If your changes cover model-related code, you should run tests
corresponding to affected models and platforms (Single card, T3K,
Galaxy). "Choose your pipeline" workflows facilitate running multiple
kinds of tests in a single run. Each offers `models-mandatory` and
`models-extended` presets.
The former includes a minimal set of tests, to be run always. The latter
extends that with additional ones - use your best judgement in deciding
which is the most appropriate for your PR.

- [ ] [![(Single) Choose your
pipeline](https://github.com/tenstorrent/tt-metal/actions/workflows/pipeline-select.yaml/badge.svg?branch=vvukomanovic/0126-bh-unints-uplift)](https://github.com/tenstorrent/tt-metal/actions/workflows/pipeline-select.yaml?query=branch:vvukomanovic/0126-bh-unints-uplift)
- [ ] `models-mandatory` preset (runs: [Device perf
regressions](https://github.com/tenstorrent/tt-metal/actions/workflows/perf-device-models.yaml)
and [Frequent model and ttnn
tests](https://github.com/tenstorrent/tt-metal/actions/workflows/fast-dispatch-full-regressions-and-models.yaml))
- [ ] `models-extended` preset (runs: the mandatory tests, plus
[Demo](https://github.com/tenstorrent/tt-metal/actions/workflows/single-card-demo-tests.yaml)
and [Model
perf](https://github.com/tenstorrent/tt-metal/actions/workflows/perf-models.yaml)
tests)
  - [ ] other selection - specify runs

- [ ] [![(T3K) Choose your
pipeline](https://github.com/tenstorrent/tt-metal/actions/workflows/pipeline-select-t3k.yaml/badge.svg?branch=vvukomanovic/0126-bh-unints-uplift)](https://github.com/tenstorrent/tt-metal/actions/workflows/pipeline-select-t3k.yaml?query=branch:vvukomanovic/0126-bh-unints-uplift)
- [ ] `models-mandatory` preset (runs: [Unit
tests](https://github.com/tenstorrent/tt-metal/actions/workflows/t3000-unit-tests.yaml))
- [ ] `models-extended` preset (runs: the mandatory tests, plus
[Demo](https://github.com/tenstorrent/tt-metal/actions/workflows/t3000-demo-tests.yaml)
and [Model
perf](https://github.com/tenstorrent/tt-metal/actions/workflows/t3000-model-perf-tests.yaml)
tests)
  - [ ] other selection - specify runs

- [ ] [![(Galaxy) Choose your
pipeline](https://github.com/tenstorrent/tt-metal/actions/workflows/pipeline-select-galaxy.yaml/badge.svg?branch=vvukomanovic/0126-bh-unints-uplift)](https://github.com/tenstorrent/tt-metal/actions/workflows/pipeline-select-galaxy.yaml?query=branch:vvukomanovic/0126-bh-unints-uplift)
- [ ] `models-mandatory` preset (runs: [Quick
tests](https://github.com/tenstorrent/tt-metal/actions/workflows/galaxy-quick.yaml))
- [ ] `models-extended` preset (runs: the mandatory tests, plus
[Demo](https://github.com/tenstorrent/tt-metal/actions/workflows/galaxy-demo-tests.yaml)
and [Model
perf](https://github.com/tenstorrent/tt-metal/actions/workflows/galaxy-model-perf-tests.yaml)
tests)
  - [ ] other selection - specify runs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants