1. 29 Jul, 2022 2 commits
  2. 26 Jul, 2022 1 commit
  3. 25 Jul, 2022 1 commit
  4. 20 Jul, 2022 1 commit
    • Aidyn-A's avatar
      [transformer] UCC async test (#1417) · a29a698f
      Aidyn-A authored
      * add test
      
      * update batch sizes
      
      * update batch sizes
      
      * small updates
      
      * delete comment
      
      * add async comm
      
      * add sync if needed
      
      * update tests
      
      * remove redundant imports
      
      * code cleanup
      
      * minor updates
      
      * update dtype for comparison
      
      * fix dtypes
      
      * fix typo
      
      * modify sizes and use common_utils.find_free_port
      
      * fix typo and use double precision
      
      * revert some changes, create test for profiling on L1
      
      * remove redundant line
      
      * revert UCC_TLS and add sync to fwd_bwd
      
      * code clean up
      
      * code clean up
      
      * modify BERT test
      
      * add comment
      a29a698f
  5. 14 Jul, 2022 1 commit
  6. 11 Jul, 2022 1 commit
  7. 07 Jul, 2022 1 commit
  8. 23 Jun, 2022 2 commits
    • Masaki Kozuki's avatar
      [transformer] Port Sequence Parallelism (takeover of #1396) (#1400) · 3ff1a10f
      Masaki Kozuki authored
      * it looks possible to remove this file
      
      * add communication collectives
      
      * update Column|RowParallelLinear
      
      * update checkpoint function
      
      * update function name
      
      * parity between public and private collectives
      
      * row parallel linear
      
      * column parallel linear
      
      * sequence parallel: p2p comm
      
      fix typo
      
      * sequence parallel: pipeline parallel
      
      * fix typo
      
      * add layernorm with sequence_parallel_enabled attr
      
      * class variable -> member variable
      
      * fix col parallel test with sequence parallel
      
      * Initial test of `forward_backward_pipelining_without_interleaving` with `model_type=ModelType.encoder_and_decoder`
      
      * add cases pretending to test sequence_parallel
      
      * Apply 2 suggestion(s) to 1 file(s)
      
      * update sequence_parallel_enabled docstring
      
      * update docstring: order of tensor dimensions, sequence_parallel_enabled behavior
      
      * Divide sequence_length if sequence parallel
      
      tensor shape should be updated if sequence parallel is enabled.
      
      * cherry-pick https://github.com/NVIDIA/Megatron-LM/commit/8474e6e54fcb9dfa37aea039352f9fb485fb6f61
      
      * type annotation
      
      * Fix matmul call in RowParallelLinear
      
      Fix `sequence_parallel_enabled` to `False` as you can see in
      https://github.com/NVIDIA/Megatron-LM/blob/d898a8991d1a08d29074f87819d1bf41517e35f5/megatron/mpu/layers.py#L511-L514
      
      * update rowparallellinear test
      
      * fix `loss_weight` is not defined in test_layers
      
      * @eqy's comment
      
      * mixed fused layer norm
      
      * fix typo
      
      * misc
      
      * test_layers cleanup
      
      * Skip Bert/GPT script
      
      Since these two models haven't gotten updated for sequence parallle, e.g. the update of the order of dimension from (batch, sequence, feature) to (sequence, batch, feature) and global variables of arguments
      
      * debug part 1/N: comment out `x.retain_grad`
      
      * debug part 2/N: [ColumnParallelLinear] comment out overriding of sequence_parallel_enabled
      
      * debug 3/N: add pipeline test with parallel mlp
      
      * Fix handling `self.input_tensor` and argument
      
      * tp2pp4 ModelType.encoder_or_decoder is failing, which can be at my fault because the backward is blaming the output and the grad_ouptut shape don't match
      
      * revert debug 1/N
      
      * defer tensor model parallel size > 1
      
      * split tensor in sequence dim
      
      * cosmetic
      
      * cosmetic: remove archaic comment
      
      * enable TP>1 for encoder_and_decoder as well
      
      * set requires_grad=True always...
      
      * Set `scatter_gather_tensors_in_pipeline` to :obj:`False`
      
      for the sake of nemo megatron's GPT works with sequence parallel enabled.
      
      * brush up comment of `requires_grad()`
      
      There's a possibility that PyTorch DistributedDataParallel hangs
      when some tensor (or parameter) doesn't require grad according to @ptrblck.
      This forced `requires_grad` in my understanding is different from that.
      
      * misc changes of scatter_gather_tensors_in_pipeline comment
      
      * guard for torch_ucc
      
      * cosmetic changes related to tests
      
      * update command line arguments
      
      * update TransformerLanguageModel
      
      * rename
      
      * move gpt to gpt.py
      
      * update bert
      
      * add all_gather for params in sequence parallel region
      
      * misc. some diffs were lost during rebasing...
      
      * updates for non sequence parallel execution
      
      * gpt with sequence parallel
      
      * Apply 2 suggestion(s) to 2 file(s)
      
      * update tensor&pipeline parallel size
      
      * why `sequence_parallel_enabled` is not supplied!? Did I messed up when rebasing?
      
      * cosmetic fix
      
      * correct key is sequence_parallel_enabled
      3ff1a10f
    • Tim Moon's avatar
      Move distributed Adam unit test to contrib dir (#1406) · 57f890a7
      Tim Moon authored
      * Increase default bucket size in distributed Adam
      
      * Move distributed Adam unit test to contrib tests
      
      Integrate into unit testing framework
      
      * Tweak hyperparameters for dist Adam optimizer test
      
      Improves numerical stability so we can keep tight tolerances. Adopting suggestions from @crcrpar.
      
      * Use distributed test infrastructure in distributed Adam unit test
      
      Suggestion from @crcrpar.
      57f890a7
  9. 22 Jun, 2022 1 commit
  10. 14 Jun, 2022 2 commits
  11. 31 May, 2022 1 commit
  12. 20 May, 2022 1 commit
  13. 19 May, 2022 2 commits
  14. 18 May, 2022 1 commit
    • Masaki Kozuki's avatar
      [transformer] Allow for different backend for Pipeline Parallel ProcessGroups (#1380) · 3490b9e1
      Masaki Kozuki authored
      
      
      * NcclDistributedTestBase
      
      * fix stupid mistake
      
      * add UCC test
      
      * add UCC backend
      
      * torch ucc tests
      
      * allows for UCC backend
      
      * Set `UCX_TLS` to `tcp,cuda_copy` & Use DDP iff it makes sense
      
      * Apply 4 suggestion(s) to 1 file(s)
      
      * mix&match NCCL & UCC
      
      * use both ucc&nccl in gpt
      
      * UCC for Pipeline Parallel, NCCL for the others
      
      * conditionally use ucc
      
      * make ucc guards more friendly
      
      * test raises when torch_ucc isn't available
      
      * Change to member variable from class variable
      Co-authored-by: default avatarAidyn Aitzhan <31858918+Aidyn-A@users.noreply.github.com>
      
      * pass async_comm to train, I mistakenly dropped it during the rebase
      
      * fix typo: functionality
      
      * Enable tensor parallel only when device count > 4
      
      I want pipeline model parallel world size to be >= 4 because
      previously I saw GPT/BERT failing when only UCC is used.
      So I'm speculating that there's some gotcha around pipeline size of 4.
      
      * Add nvidia driver version guard
      Co-authored-by: default avatarAidyn Aitzhan <31858918+Aidyn-A@users.noreply.github.com>
      
      * move world_size as it was not correctly reflected
      
      * keep eye on the nvml api thing
      
      * import unittest
      Co-authored-by: default avatarAidyn Aitzhan <31858918+Aidyn-A@users.noreply.github.com>
      3490b9e1
  15. 12 May, 2022 1 commit
    • eqy's avatar
      Async pipeline parallel (#1373) · 3fe35211
      eqy authored
      * initial check in
      
      * fix
      
      * fix test
      
      * address some review comments and cleanup
      
      * fix
      
      * bookmark
      
      * fix sync placement to come before gather
      
      * similar fix for non-gather case
      
      * add async bert
      
      * update gpt minimal test
      
      * allow selection of default pp test
      
      * fix bert test
      
      * cleanup
      
      * cleanup
      3fe35211
  16. 11 May, 2022 1 commit
  17. 29 Apr, 2022 1 commit
  18. 15 Apr, 2022 2 commits
  19. 07 Apr, 2022 1 commit
  20. 25 Mar, 2022 1 commit
    • Masaki Kozuki's avatar
      [transformer] Format & Test Refactoring (#1325) · a0ed4151
      Masaki Kozuki authored
      * try PyTorch custom TestCase class
      
      * revert
      
      * initial working example
      
      * update
      
      * data utils
      
      * fix imports
      
      * hardcode backend to nccl
      
      * fix signature
      
      * fix typo
      
      * mapping
      
      * set device
      
      * init
      
      * refactor x entropy
      
      * remove unused import & destroy model parallel
      
      * refactor random
      
      * fix test
      
      * remove migrated tests
      
      * refactor
      
      * init
      
      * separate affine weight init
      
      * init model parallel
      
      * split more
      
      * weight init fix part 1
      
      * use cpu init for consistency btwn native and tensor parallel
      
      * black
      
      * add col parallel
      
      * use a 3D tensor of square matrix for column parallel linear
      
      * skip the failing cases
      
      * migrate layers test
      
      * pipeline parallel forward/backward
      
      * fix typo
      
      * fix typo
      
      * fix
      
      * fix pipeline world size
      
      * black
      
      * rm `run_pipeline_parallel_test` in favor of test_pipeline_parallel_fwd_bwd.py
      
      * stop logging
      
      * set log level
      
      * black
      
      * license and format
      
      * fix
      
      * skip tf32 as matrices are small
      
      * remove potentially inappropriate license
      
      * Apply suggestions from code review
      
      * remove `TODO` comment
      
      * `torch.testing.assert_allclose` -> `torch.testing.assert_close`
      
      * remove comment-outs
      
      * remote unused import
      
      * minor fix
      a0ed4151
  21. 26 Feb, 2022 1 commit
  22. 25 Feb, 2022 1 commit
  23. 23 Feb, 2022 1 commit
  24. 04 Feb, 2022 1 commit
  25. 31 Jan, 2022 1 commit
  26. 28 Jan, 2022 2 commits
    • Masaki Kozuki's avatar
      small changes in test and logger format (#1278) · b1c75f6f
      Masaki Kozuki authored
      * cosmetic refactor in test
      
      * log with PID
      
      * log more info: rank, pid, filename, lineNo
      b1c75f6f
    • Masaki Kozuki's avatar
      allow for `None` batch (#1280) · a960fe8c
      Masaki Kozuki authored
      * have get_kth_microbatch deal with None batch
      
      * broadcast based on tensor parallel rank
      
      * dtype
      
      * remove unnecessary .cuda()
      
      Processes of tensor parallel rank != 0 doesn't need to prepare one or more `torch.utils.data.DataLoader` instances, which means the argument of `batch` of `get_kth_microbatch` function can be `None` but the current function implementation doesn't allow for it.
      a960fe8c
  27. 21 Jan, 2022 1 commit
  28. 17 Dec, 2021 1 commit
    • Masaki Kozuki's avatar
      Add an argument of `dtype` to forward_backward functions to specify the dtype... · b88c507e
      Masaki Kozuki authored
      Add an argument of `dtype` to forward_backward functions to specify the dtype used in p2p comm (#1249)
      
      * let users sepcify dtype for p2p comm taking the possibility of O2 style AMP into account
      
      * add `dtype` argument to forward_backward functions
      
      * fix
      
      * better message
      
      * add docstring of dtype
      
      * add a link to dtype logic of p2p comm
      b88c507e
  29. 16 Dec, 2021 1 commit
  30. 14 Dec, 2021 3 commits
  31. 10 Dec, 2021 2 commits
    • Masaki Kozuki's avatar
      Cherry-pick Megatron-LM's changes in pipeline model parallel for T5 (#1232) · 0e25fcc4
      Masaki Kozuki authored
      * update parallel_state
      
      * update pipeline common funcs - forward_step and backward_step
      
      * update pipelining w/o interleaving
      
      * type hint
      
      * merge utils into without_interleaving
      
      Motivation: functions in utils are only used by
      forward_backward_pipelining_without_interleaving
      
      * fix handling of `model_type`
      
      * fix import of DDP
      
      * update set_input_tensor method
      
      * fix
      
      * cosmetic
      
      * update model
      
      * refactor pipeline test scripts
      0e25fcc4
    • Rishi Puri's avatar
      Minimal gpt pipeline parallel (builds off of minimal_bert_pipeline_parallel)... · ab7af058
      Rishi Puri authored
      
      Minimal gpt pipeline parallel (builds off of minimal_bert_pipeline_parallel) including cpu-offloading (#1222)
      
      * minimal bert pipeline parallel test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * first draft of gpt minimal test
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * framework to scale up the gpt2 test for variety of distributed setups
      
      * adding gpt_minimal_test to list of multigpu tests
      Co-authored-by: default avatarEddie Yan <eddiey@nvidia.com>
      Co-authored-by: default avatarriship <riship@nvidia.com>
      ab7af058