Skip to content

Remove dependence of profiling tools on torch #1233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 17, 2025

Conversation

JanFSchulte
Copy link
Contributor

@JanFSchulte JanFSchulte commented Mar 17, 2025

This PR moves the WeightsTorch class introduced in #1156 to a new file under utils to avoid a direct dependence of the profiling tools on torch. This avoids having to add torch to the optional dependencies for profiling.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Tests

In the current master branch, the line from hls4ml.model.profiling import numerical in part 2 of the tutorial fails because we don't have torch in the tutorial environment. After this PR, the import no longer fails in the tutorial environment.

Checklist

  • I have read the guidelines for contributing.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have installed and run pre-commit on the files I edited or added.
  • I have added tests that prove my fix is effective or that my feature works.

@JanFSchulte JanFSchulte marked this pull request as ready for review March 17, 2025 13:25
@JanFSchulte
Copy link
Contributor Author

pre-commit.ci autofix

@JanFSchulte JanFSchulte added the please test Trigger testing by creating local PR branch label Mar 17, 2025
@vloncar vloncar merged commit ad86cb6 into fastmachinelearning:main Mar 17, 2025
7 of 9 checks passed
laurilaatu pushed a commit to laurilaatu/hls4ml that referenced this pull request May 20, 2025
* move WeightsTorch class to utils to avoid dependence of profiling tools on torch

* [pre-commit.ci] auto fixes from pre-commit hooks

* add missing import

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please test Trigger testing by creating local PR branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants