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

Profiling DataLoader #394

Closed
4 tasks
ndem0 opened this issue Jan 10, 2025 · 3 comments
Closed
4 tasks

Profiling DataLoader #394

ndem0 opened this issue Jan 10, 2025 · 3 comments
Assignees
Labels
enhancement New feature or request v0.2 implementation in v0.2

Comments

@ndem0
Copy link
Member

ndem0 commented Jan 10, 2025

Describe the solution you'd like
Just a comparison on the performance of the dataloader in these contexts:

  • no batches, single condition
  • batches, single condition
  • no batches, multiple condition
  • batches, multiple condition

Hopefully, GPU and CPU

@ndem0 ndem0 added the enhancement New feature or request label Jan 10, 2025
@dario-coscia dario-coscia added the v0.2 implementation in v0.2 label Jan 22, 2025
@dario-coscia
Copy link
Collaborator

dario-coscia commented Jan 22, 2025

@FilippoOlivo @gc031298 I would do a profiler class for this issue, something as a callback that we can attach to the trainer if needed, what do you think? Once the DataModule is updated we can start!

@FilippoOlivo
Copy link
Member

I completely agree! Maybe something inherited from https://github.com/pyutils/line_profiler

@dario-coscia
Copy link
Collaborator

After merging #428 PINA 0.2 version is fully compatible with Lightning Profilers which can be easily used by the user.

Example:

from pina import Trainer
from pina.model import FeedForward
from pina.solvers import PINN
from pina.problem.zoo import Poisson2DSquareProblem
from lightning.pytorch.profilers import AdvancedProfiler

# train and profiler
problem = Poisson2DSquareProblem()
problem.discretise_domain(10000)
model = FeedForward(len(problem.input_variables), len(problem.output_variables))
solver = PINN(model, problem)
profiler = AdvancedProfiler(dirpath=".", filename="perf_logs") # also PyTorchProfiler, SimpleProfiler, ....
trainer = Trainer(solver, profiler=profiler)
trainer.train()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v0.2 implementation in v0.2
Projects
None yet
Development

No branches or pull requests

4 participants