Skip to content
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

Update Torch profiler #1156

Merged
merged 10 commits into from
Jan 16, 2025
Merged

Conversation

jicampos
Copy link
Contributor

@jicampos jicampos commented Dec 18, 2024

Description

Type of change

Currently, the profiler supports only sequential models with nn.Linear layers. This PR enhances its capabilities by:

  • Supporting all parameterized layers that subclass nn.Module, including custom layers.
  • Adding recursive searching to detect ModuleList and Sequential types, enabling support for more complex architectures.

Note: Please delete options that are not relevant.

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

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.

@jicampos jicampos requested review from JanFSchulte and bo3z December 19, 2024 00:27
@JanFSchulte
Copy link
Contributor

pre-commit.ci autofix

@JanFSchulte
Copy link
Contributor

@jicampos Can you have a look at the pre-commit failure? It looks like it is requesting a change in an if condition that it can't auto-fix.

@JanFSchulte
Copy link
Contributor

Looks very good to me. One thing I noticed is that we are here:

elif __torch_profiling_enabled__ and isinstance(model, torch.nn.Sequential):
still restricting the profiling to nn.Sequential-type models. I think with this PR, that is no longer necessary, right?

@JanFSchulte JanFSchulte added the please test Trigger testing by creating local PR branch label Dec 19, 2024
@jicampos
Copy link
Contributor Author

elif __torch_profiling_enabled__ and isinstance(model, torch.nn.Sequential):

still restricting the profiling to nn.Sequential-type models. I think with this PR, that is no longer necessary, right?

@JanFSchulte You are right. I'm updating that now. I think adding a test would be beneficial as well. I don't see any implemented yet.

@JanFSchulte JanFSchulte added this to the v1.1.0 milestone Jan 8, 2025
@JanFSchulte
Copy link
Contributor

Hi @jicampos I think this is basically ready, right? The only thing that would be nice to be added are pytests for it, is that something you can look into?

@jicampos
Copy link
Contributor Author

jicampos commented Jan 10, 2025

@JanFSchulte That's correct—adding a test is all that's needed. I can look into it now that I'm back.

@JanFSchulte JanFSchulte added please test Trigger testing by creating local PR branch and removed please test Trigger testing by creating local PR branch labels Jan 14, 2025
@JanFSchulte
Copy link
Contributor

I think the remaining test failures are totally unrelated to this PR, some connection errors in some of the QKeras tests. So I'll merge now.

@JanFSchulte JanFSchulte merged commit fd594e0 into fastmachinelearning:main Jan 16, 2025
7 of 9 checks passed
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