Skip to content

Add stream transpose_3d implementations#1502

Closed
hadronic-arvind wants to merge 3 commits into
fastmachinelearning:mainfrom
hadronic-arvind:issue-712-transpose-3d-stream
Closed

Add stream transpose_3d implementations#1502
hadronic-arvind wants to merge 3 commits into
fastmachinelearning:mainfrom
hadronic-arvind:issue-712-transpose-3d-stream

Conversation

@hadronic-arvind

@hadronic-arvind hadronic-arvind commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Fix transpose_3d for stream I/O in the Quartus and Catapult backends.
Add stream-mode transpose helpers that unpack the input stream, apply the 3D permutation mapping, and repack the output stream.
Add a regression test for a Keras Permute((3, 1, 2)) model using io_stream.
Make the pyproject-fmt pre-commit hook explicitly install tomli so the Python 3.8 format job does not fail on the hook environment.

Fixes #712.

Tests

Reproduced the Quartus failure before the fix in a clean local clone:

error: no matching function for call to 'transpose_3d'
candidate function template not viable: no known conversion from 'stream<input_t>' to 'input_t *'

After the fix:

PATH="/Users/arvindtawker/Documents/Codex/hls4ml/.agents/bin:$PATH" /Users/arvindtawker/miniconda3/envs/hls4ml-py310/bin/python -m pytest -q test/pytest/test_transpose_concat.py::test_stream_3d_permute_pack_mismatch --override-ini addopts=
4 passed

Additional verification:

PATH="/Users/arvindtawker/Documents/Codex/hls4ml/.agents/bin:$PATH" /Users/arvindtawker/miniconda3/envs/hls4ml-py310/bin/python -m pytest -q test/pytest/test_transpose_concat.py -k 'not oneAPI and not oneapi' --override-ini addopts=
14 passed, 4 deselected
PATH="/Users/arvindtawker/Documents/Codex/hls4ml/.agents/bin:$PATH" /Users/arvindtawker/miniconda3/envs/hls4ml-py310/bin/pre-commit run --all-files
Passed

@vloncar

vloncar commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Has this been validated on hardware?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transpose_3d for hls_stream missing

2 participants