2024-04-03 09:15:47 +00:00
import warnings
2023-11-10 02:49:50 +00:00
from dataclasses import dataclass , field
2023-11-19 13:05:05 +00:00
from typing import Any , Dict , Optional
2023-06-19 05:53:17 +00:00
2023-06-30 01:58:08 +00:00
import torch . distributed as dist
from torch . distributed import ProcessGroup
2023-07-05 06:16:55 +00:00
from colossalai . pipeline . stage_manager import PipelineStageManager
2024-04-22 03:25:39 +00:00
from . grad_ckpt_config import GradientCheckpointConfig , PipelineGradientCheckpointConfig
2024-04-01 03:34:58 +00:00
2023-09-19 06:20:26 +00:00
__all__ = [ " ShardConfig " ]
2024-04-03 09:15:47 +00:00
SUPPORT_SP_MODE = [ " split_gather " , " ring " , " all_to_all " ]
2023-05-24 08:01:26 +00:00
2023-05-22 07:02:17 +00:00
@dataclass
class ShardConfig :
2023-06-09 06:36:54 +00:00
r """
The config for sharding the huggingface model
Args :
2023-09-15 02:56:39 +00:00
tensor_parallel_process_group ( Optional [ ProcessGroup ] ) : The process group of tensor parallelism , it ' s necessary when using tensor parallel. Defaults to None, which is the global process group.
pipeline_stage_manager ( Optional [ PipelineStageManager ] ) : If using pipeline parallelism , it ' s necessary to specify a pipeline stage manager for inter-process communication in pipeline parallelism. Defaults to None, which means not using pipeline parallelism.
enable_tensor_parallelism ( bool ) : Whether to use tensor parallelism . Defaults to True .
enable_fused_normalization ( bool ) : Whether to use fused layernorm . Defaults to False .
enable_flash_attention ( bool , optional ) : Whether to switch on flash attention . Defaults to False .
enable_jit_fused ( bool , optional ) : Whether to switch on JIT fused operators . Defaults to False .
enable_sequence_parallelism ( bool ) : Whether to turn on sequence parallelism , which partitions non - tensor - parallel regions along the sequence dimension . Defaults to False .
2024-01-04 08:21:55 +00:00
enable_sequence_overlap ( bool ) : Whether to turn on sequence overlap , which overlap the computation and communication in sequence parallelism . It can only be used when enable_sequence_parallelism is True . Defaults to False .
2024-04-01 03:34:58 +00:00
gradient_checkpoint_config ( Optional [ GradientCheckpointConfig ] ) : The gradient checkpoint config . Defaults to None .
2024-01-04 08:21:55 +00:00
enable_all_optimization ( bool ) : Whether to turn on all optimization tools including ' fused normalization ' , ' flash attention ' , ' JIT fused operators ' , ' sequence parallelism ' and ' sequence overlap ' . Defaults to False .
2023-05-22 07:02:17 +00:00
"""
2024-04-22 03:25:39 +00:00
2023-07-05 06:16:55 +00:00
tensor_parallel_process_group : Optional [ ProcessGroup ] = None
2024-04-03 09:15:47 +00:00
sequence_parallel_process_group : Optional [ ProcessGroup ] = None
2023-07-05 06:16:55 +00:00
pipeline_stage_manager : Optional [ PipelineStageManager ] = None
2023-07-04 01:57:03 +00:00
enable_tensor_parallelism : bool = True
2024-04-03 09:15:47 +00:00
enable_all_optimization : bool = False
2023-06-30 01:32:37 +00:00
enable_fused_normalization : bool = False
2023-08-07 08:41:07 +00:00
enable_flash_attention : bool = False
enable_jit_fused : bool = False
2023-09-22 03:02:50 +00:00
enable_sequence_parallelism : bool = False
2024-04-03 09:15:47 +00:00
sequence_parallelism_mode : str = None
2023-09-22 03:02:50 +00:00
enable_sequence_overlap : bool = False
2024-03-18 07:55:11 +00:00
parallel_output : bool = True
[shardformer] refactor embedding resize (#5603)
* [branch rebase] rebase main to Feature/resize_embedding (#5554)
* fix
* [release] update version (#5411)
* [hotfix] fix typo s/keywrods/keywords etc. (#5429)
* [devops] fix compatibility (#5444)
* [devops] fix compatibility
* [hotfix] update compatibility test on pr
* [devops] fix compatibility
* [devops] record duration during comp test
* [test] decrease test duration
* fix falcon
* [shardformer] fix gathering output when using tensor parallelism (#5431)
* fix
* padding vocab_size when using pipeline parallellism
padding vocab_size when using pipeline parallellism
fix
fix
* fix
* fix
fix
fix
* fix gather output
* fix
* fix
* fix
fix resize embedding
fix resize embedding
* fix resize embedding
fix
* revert
* revert
* revert
* [doc] release Open-Sora 1.0 with model weights (#5468)
* [doc] release Open-Sora 1.0 with model weights
* [doc] release Open-Sora 1.0 with model weights
* [doc] release Open-Sora 1.0 with model weights
* [doc] update open-sora demo (#5479)
* [doc] update open-sora demo
* [doc] update open-sora demo
* [doc] update open-sora demo
* [example] add grok-1 inference (#5485)
* [misc] add submodule
* remove submodule
* [example] support grok-1 tp inference
* [example] add grok-1 inference script
* [example] refactor code
* [example] add grok-1 readme
* [exmaple] add test ci
* [exmaple] update readme
---------
Co-authored-by: Hongxin Liu <lhx0217@gmail.com>
Co-authored-by: digger yu <digger-yu@outlook.com>
Co-authored-by: binmakeswell <binmakeswell@gmail.com>
* [CI] run pre-commit (#5577)
* fix
* [release] update version (#5411)
* [hotfix] fix typo s/keywrods/keywords etc. (#5429)
* [devops] fix compatibility (#5444)
* [devops] fix compatibility
* [hotfix] update compatibility test on pr
* [devops] fix compatibility
* [devops] record duration during comp test
* [test] decrease test duration
* fix falcon
* [shardformer] fix gathering output when using tensor parallelism (#5431)
* fix
* padding vocab_size when using pipeline parallellism
padding vocab_size when using pipeline parallellism
fix
fix
* fix
* fix
fix
fix
* fix gather output
* fix
* fix
* fix
fix resize embedding
fix resize embedding
* fix resize embedding
fix
* revert
* revert
* revert
* [doc] release Open-Sora 1.0 with model weights (#5468)
* [doc] release Open-Sora 1.0 with model weights
* [doc] release Open-Sora 1.0 with model weights
* [doc] release Open-Sora 1.0 with model weights
* [doc] update open-sora demo (#5479)
* [doc] update open-sora demo
* [doc] update open-sora demo
* [doc] update open-sora demo
* [example] add grok-1 inference (#5485)
* [misc] add submodule
* remove submodule
* [example] support grok-1 tp inference
* [example] add grok-1 inference script
* [example] refactor code
* [example] add grok-1 readme
* [exmaple] add test ci
* [exmaple] update readme
* run pre-commit
---------
Co-authored-by: Hongxin Liu <lhx0217@gmail.com>
Co-authored-by: digger yu <digger-yu@outlook.com>
Co-authored-by: binmakeswell <binmakeswell@gmail.com>
* [rebase] rebase main to resize-embedding (#5581)
* [release] grok-1 314b inference (#5490)
* [release] grok-1 inference
* [release] grok-1 inference
* [release] grok-1 inference
* [example] update Grok-1 inference (#5495)
* revise grok-1 example
* remove unused arg in scripts
* prevent re-installing torch
* update readme
* revert modifying colossalai requirements
* add perf
* trivial
* add tokenizer url
* [hotfix] set return_outputs=False in examples and polish code (#5404)
* fix: simplify merge_batch
* fix: use return_outputs=False to eliminate extra memory consumption
* feat: add return_outputs warning
* style: remove `return_outputs=False` as it is the default value
* [release] grok-1 inference benchmark (#5500)
* [release] grok-1 inference benchmark
* [release] grok-1 inference benchmark
* [release] grok-1 inference benchmark
* [release] grok-1 inference benchmark
* [release] grok-1 inference benchmark
* [shardformer]Fix lm parallel. (#5480)
* fix
* padding vocab_size when using pipeline parallellism
padding vocab_size when using pipeline parallellism
fix
fix
* fix
* fix
fix
fix
* fix gather output
* fix
* fix
* fix
fix resize embedding
fix resize embedding
* fix resize embedding
fix
* revert
* revert
* revert
* fix lm forward distribution
* fix
* test ci
* fix
* [fix] fix grok-1 example typo (#5506)
* [devops] fix example test ci (#5504)
* Fix ColoTensorSpec for py11 (#5440)
* fixed layout converter caching and updated tester
* Empty-Commit
* [shardformer] update colo attention to support custom mask (#5510)
* [feature] refactor colo attention (#5462)
* [extension] update api
* [feature] add colo attention
* [feature] update sdpa
* [feature] update npu attention
* [feature] update flash-attn
* [test] add flash attn test
* [test] update flash attn test
* [shardformer] update modeling to fit colo attention (#5465)
* [misc] refactor folder structure
* [shardformer] update llama flash-attn
* [shardformer] fix llama policy
* [devops] update tensornvme install
* [test] update llama test
* [shardformer] update colo attn kernel dispatch
* [shardformer] update blip2
* [shardformer] update chatglm
* [shardformer] update gpt2
* [shardformer] update gptj
* [shardformer] update opt
* [shardformer] update vit
* [shardformer] update colo attention mask prep
* [shardformer] update whisper
* [test] fix shardformer tests (#5514)
* [test] fix shardformer tests
* [test] fix shardformer tests
* [format] applied code formatting on changed files in pull request 5510 (#5517)
Co-authored-by: github-actions <github-actions@github.com>
* [shardformer] fix pipeline forward error if custom layer distribution is used (#5189)
* Use self.[distribute_layers|get_stage_index] to exploit custom layer distribution
* Change static methods for t5 layer distribution to member functions
* Change static methods for whisper layer distribution to member functions
* Replace whisper policy usage with self one
* Fix test case to use non-static layer distribution methods
* fix: fix typo
---------
Co-authored-by: Wenhao Chen <cwher@outlook.com>
* [Fix] Grok-1 use tokenizer from the same pretrained path (#5532)
* [fix] use tokenizer from the same pretrained path
* trust remote code
* [ColossalChat] Update RLHF V2 (#5286)
* Add dpo. Fix sft, ppo, lora. Refactor all
* fix and tested ppo
* 2 nd round refactor
* add ci tests
* fix ci
* fix ci
* fix readme, style
* fix readme style
* fix style, fix benchmark
* reproduce benchmark result, remove useless files
* rename to ColossalChat
* use new image
* fix ci workflow
* fix ci
* use local model/tokenizer for ci tests
* fix ci
* fix ci
* fix ci
* fix ci timeout
* fix rm progress bar. fix ci timeout
* fix ci
* fix ci typo
* remove 3d plugin from ci temporary
* test environment
* cannot save optimizer
* support chat template
* fix readme
* fix path
* test ci locally
* restore build_or_pr
* fix ci data path
* fix benchmark
* fix ci, move ci tests to 3080, disable fast tokenizer
* move ci to 85
* support flash attention 2
* add all-in-one data preparation script. Fix colossal-llama2-chat chat template
* add hardware requirements
* move ci test data
* fix save_model, add unwrap
* fix missing bos
* fix missing bos; support grad accumulation with gemini
* fix ci
* fix ci
* fix ci
* fix llama2 chat template config
* debug sft
* debug sft
* fix colossalai version requirement
* fix ci
* add sanity check to prevent NaN loss
* fix requirements
* add dummy data generation script
* add dummy data generation script
* add dummy data generation script
* add dummy data generation script
* update readme
* update readme
* update readme and ignore
* fix logger bug
* support parallel_output
* modify data preparation logic
* fix tokenization
* update lr
* fix inference
* run pre-commit
---------
Co-authored-by: Tong Li <tong.li352711588@gmail.com>
* [shardformer, pipeline] add `gradient_checkpointing_ratio` and heterogenous shard policy for llama (#5508)
* feat: add `GradientCheckpointConfig` and `PipelineGradientCheckpointConfig`
* feat: apply `GradientCheckpointConfig` to policy and llama_forward
* feat: move `distribute_layer` and `get_stage_index` to PipelineStageManager
* fix: add optional args for `distribute_layer` and `get_stage_index`
* fix: fix changed API calls
* test: update llama tests
* style: polish `GradientCheckpointConfig`
* fix: fix pipeline utils tests
* fix incorrect sharding without zero (#5545)
Co-authored-by: Edenzzzz <wtan45@wisc.edu>
* [shardformer] Sequence Parallelism Optimization (#5533)
* sequence parallel optimization
* validate sequence parallel in llama (code to be polished)
* shardformer api writing
* integrate sequence parallel in ShardFormer
* fix pp bugs and sp bugs for LlaMa model
* integrating ring-based sequence parallelism into ShardFormer
* [sequence parallelism]: Add fused megatron function
* integrating ring-based sequence parallelism into ShardFormer
---------
Co-authored-by: linsj20 <linsj20@mails.tsinghua.edu.cn>
* fix bugs when useing sp and flashattention together
* fix operation function name
* support flash attention for ulysses-style sp
* clarify sp process group
* fix compatibility bugs in moe plugin
* fix fused linear bugs
* fix linear layer test
* support gpt model all-to-all sp
* modify shard data dimension (meant to be dim=-1)
* support megtron-style sp and distributed attn for llama model
* [shardformer] add megatron sp to llama
* support llama7B 128k with distributed attention
* [shardformer] robustness enhancement
* add block attn
* sp mode 1: keep input as a complete sequence
* fix sp compatability
* finish sp mode 3 support for gpt
* using all_to_all_single when batch size is 1
* support mode 2 sp in gpt2 (#5)
* [shardformer] add megatron sp to llama
* support llama7B 128k with distributed attention
* [shardformer] robustness enhancement
* add block attn
* sp mode 1: keep input as a complete sequence
* fix sp compatability
* refactor ring implementation
* support mode 2 sp in gpt2
* polish code
* enable distributed attn mask when using sp mode 2 and 3 in llama
* automatically enable flash attn when using sp mode 2 and 3 in llama
* inplace attn mask
* add zero2 support for sequence parallel
* polish code
* fix bugs
* fix gemini checkpoint io
* loose tensor checking atol and rtol
* add comment
* fix llama layernorm grad
* fix zero grad
* fix zero grad
* fix conflict
* update split and gather auto grad func
* sequence parallel: inside text split (#6)
* polish code (part 1)
* polish code (part 2)
* polish code (part 2.5)
* polish code (part 3)
* sequence parallel: inside text split
* miscellaneous minor fixes
* polish code
* fix ulysses style ZeRO
* sequence parallel: inside text split
* miscellaneous minor fixes
* disaggregate sp group and dp group for sp
* fix llama and gpt sp
* polish code
* move ulysses grad sync to ddp (#9)
* remove zero_stage and unbind the grad sync for alltoall sp
* add 2d group creation test
* move ulysses grad sync to ddp
* add 2d group creation test
* remove useless code
* change shard config not to enable sp when enable_all_optimizations
* add sp warnings for several model
* remove useless code
---------
Co-authored-by: linsj20 <linsj20@mails.tsinghua.edu.cn>
* [hotfix] quick fixes to make legacy tutorials runnable (#5559)
Co-authored-by: Edenzzzz <wtan45@wisc.edu>
* [fix] fix typo s/muiti-node /multi-node etc. (#5448)
* [hotfix] fix typo s/get_defualt_parser /get_default_parser (#5548)
* [devops] remove post commit ci (#5566)
* [devops] remove post commit ci
* [misc] run pre-commit on all files
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---------
Co-authored-by: binmakeswell <binmakeswell@gmail.com>
Co-authored-by: Yuanheng Zhao <54058983+yuanheng-zhao@users.noreply.github.com>
Co-authored-by: Wenhao Chen <cwher@outlook.com>
Co-authored-by: Hongxin Liu <lhx0217@gmail.com>
Co-authored-by: Rocky Duan <dementrock@users.noreply.github.com>
Co-authored-by: Edenzzzz <wtan45@wisc.edu>
Co-authored-by: Edenzzzz <wenxuan.tan@wisc.edu>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Insu Jang <insujang@umich.edu>
Co-authored-by: YeAnbang <44796419+YeAnbang@users.noreply.github.com>
Co-authored-by: Tong Li <tong.li352711588@gmail.com>
Co-authored-by: Zhongkai Zhao <kanezz620@gmail.com>
Co-authored-by: linsj20 <linsj20@mails.tsinghua.edu.cn>
Co-authored-by: digger yu <digger-yu@outlook.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* [shardformer]enable padding vocabulary size. (#5489)
* padding vocab_size when using pipeline parallellism
padding vocab_size when using pipeline parallellism
fix
fix
* fix
* fix
fix
fix
* fix gather output
* fix
* fix
* fix
fix resize embedding
fix resize embedding
* fix resize embedding
fix
* revert
* revert
* revert
* padding vocab
* padding vocabe
* fix
* fix
* fxi
* test ci
* fix
fix
fix
fix
* fix
fix
* fix
* fix
* Update hybrid_parallel_plugin.py
fix
fix
fix
* fix
fix
* fix
fix
* fix
* resolve super init
resolve super init
resolve super init
resolve super init
* resolve comments
* fix
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* vocab checkpointio
* padding vocab_size when using pipeline parallellism
padding vocab_size when using pipeline parallellism
fix
fix
* fix
fix
fix
* fix
* fix
fix resize embedding
fix resize embedding
* fix resize embedding
fix
* revert
* revert
* padding vocab
* fix
* fix
fix
* fix
fix
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix ci
* fix
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix
* cherry-pick
* revert moe modify
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix
fix
fix
fix
fix
fix
fix
fix
* resolve comments
resolve comments
resolve comments
resolve comments
resolve comments
* ptensor
ptensor
resolve comments
fix
fix
fix
fix
fix
resolve comments
resolve comments
resolve comments
resolve comments
resolve comments
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hongxin Liu <lhx0217@gmail.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix rebase
* fix rebase
---------
Co-authored-by: Hongxin Liu <lhx0217@gmail.com>
Co-authored-by: digger yu <digger-yu@outlook.com>
Co-authored-by: binmakeswell <binmakeswell@gmail.com>
Co-authored-by: Yuanheng Zhao <54058983+yuanheng-zhao@users.noreply.github.com>
Co-authored-by: Wenhao Chen <cwher@outlook.com>
Co-authored-by: Rocky Duan <dementrock@users.noreply.github.com>
Co-authored-by: Edenzzzz <wtan45@wisc.edu>
Co-authored-by: Edenzzzz <wenxuan.tan@wisc.edu>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Insu Jang <insujang@umich.edu>
Co-authored-by: YeAnbang <44796419+YeAnbang@users.noreply.github.com>
Co-authored-by: Tong Li <tong.li352711588@gmail.com>
Co-authored-by: Zhongkai Zhao <kanezz620@gmail.com>
Co-authored-by: linsj20 <linsj20@mails.tsinghua.edu.cn>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-18 08:10:18 +00:00
make_vocab_size_divisible_by : int = 64
2024-04-01 03:34:58 +00:00
gradient_checkpoint_config : Optional [ GradientCheckpointConfig ] = None
2023-11-19 13:05:05 +00:00
extra_kwargs : Dict [ str , Any ] = field ( default_factory = dict )
2023-09-22 03:02:50 +00:00
# pipeline_parallel_size: int
# data_parallel_size: int
2023-06-19 05:53:17 +00:00
# tensor_parallel_mode: Literal['1d', '2d', '2.5d', '3d']
2023-06-30 02:56:29 +00:00
@property
def tensor_parallel_size ( self ) :
return self . _tensor_parallel_size
2024-04-03 09:15:47 +00:00
@property
def sequence_parallel_size ( self ) :
return self . _sequence_parallel_size
2023-06-19 05:53:17 +00:00
def __post_init__ ( self ) :
2024-04-03 09:15:47 +00:00
# turn on all optimization if all_optimization is set to True
if self . enable_all_optimization :
self . _turn_on_all_optimization ( )
if self . enable_sequence_parallelism :
self . sequence_parallelism_mode = (
" split_gather " if self . sequence_parallelism_mode is None else self . sequence_parallelism_mode
2023-09-19 06:20:26 +00:00
)
2024-04-03 09:15:47 +00:00
assert (
self . sequence_parallelism_mode in SUPPORT_SP_MODE
) , f " Sequence parallelism mode { self . sequence_parallelism_mode } is not in the supported list { SUPPORT_SP_MODE } "
if self . sequence_parallelism_mode in [ " split_gather " , " ring " ] :
assert (
self . enable_tensor_parallelism
) , f " sequence parallelism mode { self . sequence_parallelism_mode } can only be used when enable_tensor_parallelism is True "
elif self . sequence_parallelism_mode in [ " all_to_all " ] :
assert (
not self . enable_tensor_parallelism
) , f " sequence parallelism mode { self . sequence_parallelism_mode } can only be used when enable_tensor_parallelism is False "
if self . enable_sequence_overlap :
self . enable_sequence_overlap = False
warnings . warn (
f " The enable_sequence_overlap flag will be ignored in sequence parallelism mode { self . sequence_parallelism_mode } "
)
else :
if self . sequence_parallelism_mode :
self . sequence_parallelism_mode = None
warnings . warn (
f " The sequence_parallelism_mode will be ignored when enable_sequence_parallelism is False "
)
assert (
not self . enable_sequence_overlap
) , f " enable_sequence_overlap can only be set to True when enable_sequence_parallelism is True "
# get the tensor parallel size
2023-07-04 01:57:03 +00:00
if not self . enable_tensor_parallelism :
self . _tensor_parallel_size = 1
else :
self . _tensor_parallel_size = dist . get_world_size ( self . tensor_parallel_process_group )
2024-04-03 09:15:47 +00:00
# get the sequence parallel size
if not self . enable_sequence_parallelism :
self . _sequence_parallel_size = 1
else :
self . _sequence_parallel_size = dist . get_world_size ( self . sequence_parallel_process_group )
2023-06-30 02:56:29 +00:00
2024-04-22 03:25:39 +00:00
if (
self . pipeline_stage_manager is not None
and isinstance ( self . gradient_checkpoint_config , PipelineGradientCheckpointConfig )
and self . gradient_checkpoint_config . _customize_num_layers_per_stage
) :
self . pipeline_stage_manager . set_distribution_config (
self . gradient_checkpoint_config . num_model_layers ,
self . gradient_checkpoint_config . num_layers_per_stage ,
)
2023-06-30 02:56:29 +00:00
def _turn_on_all_optimization ( self ) :
"""
Turn on all optimization .
"""
# you can add all the optimization flag here
2024-04-24 15:04:06 +00:00
try :
from apex . normalization import FusedLayerNorm as ApexFusedLayerNorm # noqa
apex_avail = True
except ImportError :
apex_avail = False
warnings . warn ( " You set enable_all_optimization=True, but apex is not installed. " )
self . enable_fused_normalization = apex_avail
2023-08-07 08:41:07 +00:00
self . enable_flash_attention = True
self . enable_jit_fused = True
2024-04-02 12:11:18 +00:00
# This can cause non-in-place param sharding when used without ZeRO.
# It may also slow down training when seq len is small. Plz enable manually.
# self.enable_sequence_parallelism = True
# self.enable_sequence_overlap = True
2023-09-11 17:22:56 +00:00
def _infer ( self ) :
"""
Set default params for inference .
"""
2023-10-27 08:19:54 +00:00
# assert self.pipeline_stage_manager is None, "pipeline parallelism is not supported in inference for now"