Skip to content

fix(nki): mp2_energy accumulator pattern to avoid 0-D SBUF allocation #42

fix(nki): mp2_energy accumulator pattern to avoid 0-D SBUF allocation

fix(nki): mp2_energy accumulator pattern to avoid 0-D SBUF allocation #42

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
# Opt into Node.js 24 for all third-party JavaScript actions ahead of
# GitHub's June 2026 default switch. Silences the Node 20 deprecation
# notice emitted by setup-uv and codecov-action's github-script dep.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v6
- run: uvx ruff check .
- run: uvx ruff format --check .
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --extra dev
- run: uv run pytest tests/ -v -x --tb=short -m "not neuron and not nki_simulator" --cov=trntensor --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: trnsci/trntensor
nki-simulator:
# Runs NKI kernels through nki.simulate(kernel)(numpy_args) on CPU.
# Catches Python-trace-level errors (bad kwargs, dropped ops, shape
# mismatches) pre-merge without AWS round-trips. MLIR verifier
# errors remain hardware-only (simulator explicitly skips compile).
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
- run: uv sync --extra dev
- name: Install NKI simulator
run: uv pip install --extra-index-url https://pip.repos.neuron.amazonaws.com "nki>=0.3.0"
- name: Run simulator-backed kernel tests
env:
TRNTENSOR_USE_SIMULATOR: "1"
run: uv run pytest tests/ -v -m nki_simulator --tb=short