-
Notifications
You must be signed in to change notification settings - Fork 170
SF2M-GRN single-cell experiments (notebooks) #168
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
Open
lazaratan
wants to merge
21
commits into
atong01:single_cell_HD
Choose a base branch
from
lazaratan:single-cell-sf2m-grn
base: single_cell_HD
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* change pytorch lightning version * fix pip version * fix pip in code cov
* added multithreading to OTPlanSampler for "exact" solver * changed type hinting
* make code changes in `train_cifar10.py` to allow DDP (distributed data parallel) * add instructions to README on how to run cifar10 image generation code on multiple GPUs * fix: when running cifar10 image generation on multiple gpus, use `rank` for device setting * fix: load checkpoint on right device * fix runner ci requirements (atong01#125) * change pytorch lightning version * fix pip version * fix pip in code cov * change variable name `world_size` to `total_num_gpus` * change: do not overwrite batch size flag * add, refactor: calculate number of epochs based on total number of steps, rewrite training loop to use epochs instead of steps * fix: add `sampler.set_epoch(epoch)` to training loop to shuffle data in distributed mode * rename file, update README * add original CIFAR10 training file --------- Co-authored-by: Alexander Tong <[email protected]>
* Update workflows due to upstream updates. Future work: Unpin numpy version and pin docformatter.
* Add CNF * Update notebook
…1#149) * Fixed global_step in train_cifar10_ddp.py * fixed torchrun command for train_cifar10_ddp.py * Update train_cifar10_ddp.py
* unpin numpy,pandas and pot versions * Update setup.py * Update test.yaml * Update setup.py * Update setup.py * Update test_runner.yaml * Update runner-requirements.txt
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Reviewer's GuideThis PR extends the CIFAR-10 examples with end-to-end distributed (DDP) training support, refactors utilities for flexible FID computation, tightens dependency versions, adjusts CI pipelines, enhances the OT sampler, refreshes documentation, and bumps the package version. Sequence diagram for DDP-based CIFAR-10 training workflowsequenceDiagram
participant User as actor User
participant torchrun as torchrun
participant train_script as train_cifar10_ddp.py
participant setup as setup()
participant DDP as DistributedDataParallel
participant DataLoader as DataLoader
participant Model as UNetModelWrapper
participant FM as FlowMatcher
participant Optim as Optimizer
participant EMA as ema()
participant Save as generate_samples/torch.save
User->>torchrun: Launch DDP training (torchrun ... train_cifar10_ddp.py ...)
torchrun->>train_script: Start process per GPU
train_script->>setup: setup(rank, total_num_gpus, ...)
setup-->>train_script: Initialize distributed environment
train_script->>DataLoader: Create DataLoader with DistributedSampler
train_script->>Model: Initialize UNetModelWrapper
train_script->>DDP: Wrap model in DistributedDataParallel
loop Training Steps
train_script->>DataLoader: Fetch batch (next(datalooper))
train_script->>FM: sample_location_and_conditional_flow(x0, x1)
train_script->>Model: Forward pass (vt = net_model(t, xt))
train_script->>Optim: Backward + step
train_script->>EMA: Update EMA model
alt Save checkpoint
train_script->>Save: generate_samples, torch.save
end
end
Class diagram for new and updated CIFAR-10 DDP training utilitiesclassDiagram
class train_cifar10_ddp {
+train(rank, total_num_gpus, argv)
+main(argv)
}
class setup {
+setup(rank, total_num_gpus, master_addr, master_port, backend)
}
class UNetModelWrapper
class DistributedDataParallel
class DataLoader
class FlowMatcher
class Optimizer
class ema
train_cifar10_ddp --> setup : uses
train_cifar10_ddp --> UNetModelWrapper : uses
train_cifar10_ddp --> DistributedDataParallel : uses
train_cifar10_ddp --> DataLoader : uses
train_cifar10_ddp --> FlowMatcher : uses
train_cifar10_ddp --> Optimizer : uses
train_cifar10_ddp --> ema : uses
setup <.. DistributedDataParallel : initializes
Class diagram for updated UNetModelWrapper checkpointingclassDiagram
class UNetModelWrapper {
+forward(x)
+_forward(x)
-use_checkpoint
}
UNetModelWrapper : +forward(x) uses self.use_checkpoint
UNetModelWrapper --> checkpoint : uses
class checkpoint
UNetModelWrapper --> _forward : calls
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding notebooks for SF2M-GRN experiments (with link to processed data on Hugging Face).
Summary by Sourcery
Enable distributed data parallel training for CIFAR10 examples, add configurable FID batch size and OT solver threading, update dependencies, CI workflows, documentation, and bump version to 1.0.7
New Features:
Enhancements:
Build:
CI:
Documentation: