Upload folder using huggingface_hub
Browse files- .gitattributes +2 -0
- train/.hydra/config.yaml +115 -0
- train/.hydra/hydra.yaml +173 -0
- train/.hydra/overrides.yaml +5 -0
- train/ckpt_49999/global_step50000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
- train/ckpt_49999/global_step50000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
- train/ckpt_49999/global_step50000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
- train/ckpt_49999/global_step50000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
- train/ckpt_49999/global_step50000/mp_rank_00_model_states.pt +3 -0
- train/ckpt_49999/latest +1 -0
- train/ckpt_49999/output_dir/config.json +220 -0
- train/ckpt_49999/output_dir/model.safetensors +3 -0
- train/ckpt_49999/zero_to_fp32.py +760 -0
- train/run.log +3 -0
- train/run_debug.log +155 -0
- train/run_inference.log +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
train/run.log filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
train/run_inference.log filter=lfs diff=lfs merge=lfs -text
|
train/.hydra/config.yaml
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
data_wrapper:
|
| 2 |
+
dataset:
|
| 3 |
+
garment_tokenizer:
|
| 4 |
+
standardize:
|
| 5 |
+
rotations:
|
| 6 |
+
_target_: data.datasets.panel_configs.StatsConfig
|
| 7 |
+
scale:
|
| 8 |
+
- 1
|
| 9 |
+
- 1
|
| 10 |
+
- 1
|
| 11 |
+
- 1
|
| 12 |
+
shift:
|
| 13 |
+
- 0
|
| 14 |
+
- 0
|
| 15 |
+
- 0
|
| 16 |
+
- 0
|
| 17 |
+
translations:
|
| 18 |
+
_target_: data.datasets.panel_configs.StatsConfig
|
| 19 |
+
scale:
|
| 20 |
+
- 26.06867645
|
| 21 |
+
- 32.42920198
|
| 22 |
+
- 22.29905009
|
| 23 |
+
shift:
|
| 24 |
+
- -0.0125378371
|
| 25 |
+
- 113.507532
|
| 26 |
+
- 2.63046369
|
| 27 |
+
vertices:
|
| 28 |
+
_target_: data.datasets.panel_configs.StatsConfig
|
| 29 |
+
scale:
|
| 30 |
+
- 24.4920733
|
| 31 |
+
- 26.60402835
|
| 32 |
+
shift:
|
| 33 |
+
- 8.44428116
|
| 34 |
+
- 16.84081321
|
| 35 |
+
_target_: data.datasets.panel_configs.StandardizeConfig
|
| 36 |
+
_target_: data.garment_tokenizers.gcd_garment_tokenizer.GCDGarmentTokenizer
|
| 37 |
+
random_tag: false
|
| 38 |
+
num_tags: 108
|
| 39 |
+
_target_: data.datasets.gcd_mm_dataset.GCDMM
|
| 40 |
+
root_dir: datadir/GarmentCodeData_v2/GarmentCodeData_v2
|
| 41 |
+
editing_dir: datadir/GarmentCodeData_v2/GCD-MM/editing_dir/garmentcodedata_editing
|
| 42 |
+
caption_dir: datadir/GarmentCodeData_v2/GCD-MM/caption_dir/long-caption-processed
|
| 43 |
+
editing_flip_prob: 0.5
|
| 44 |
+
sampling_rate:
|
| 45 |
+
- 0.2
|
| 46 |
+
- 0.2
|
| 47 |
+
- 0.2
|
| 48 |
+
- 0.2
|
| 49 |
+
- 0.2
|
| 50 |
+
panel_classification: assets/data_configs/panel_classes_garmentcodedata.json
|
| 51 |
+
load_by_dataname: assets/data_configs/garmentcodedata_list.txt
|
| 52 |
+
image_size: 448
|
| 53 |
+
max_num_patches: 12
|
| 54 |
+
conv_template: internvl2_5
|
| 55 |
+
_target_: data.data_wrappers.data_wrapper.DataWrapper
|
| 56 |
+
_recursive_: false
|
| 57 |
+
collate_fn: data.data_wrappers.collate_fns.collate_fn
|
| 58 |
+
split_file: datadir/GarmentCodeData_v2/garmentcodedata_datasplit_v2.json
|
| 59 |
+
trainer:
|
| 60 |
+
_target_: trainers.trainer.Trainer
|
| 61 |
+
lr: 1.0e-05
|
| 62 |
+
beta1: 0.9
|
| 63 |
+
beta2: 0.95
|
| 64 |
+
grad_accumulation_steps: 10
|
| 65 |
+
batch_size: 1
|
| 66 |
+
num_steps: 50000
|
| 67 |
+
save_freq: 1000
|
| 68 |
+
experiment:
|
| 69 |
+
wandb_info:
|
| 70 |
+
wandb_dir: wandb
|
| 71 |
+
wandb_cache_dir: wandb_cache
|
| 72 |
+
project_name: AIpparel
|
| 73 |
+
run_name: eval_multimodal
|
| 74 |
+
run_id: null
|
| 75 |
+
local_dir: null
|
| 76 |
+
model:
|
| 77 |
+
edge_loss_weight: 0.1
|
| 78 |
+
pos_embed: true
|
| 79 |
+
num_freq: 0
|
| 80 |
+
pos_embed_type: sinusoidal
|
| 81 |
+
verts_bounds:
|
| 82 |
+
- -4
|
| 83 |
+
- -4
|
| 84 |
+
- 4
|
| 85 |
+
- 4
|
| 86 |
+
transf_bounds:
|
| 87 |
+
- -4
|
| 88 |
+
- -4
|
| 89 |
+
- -4
|
| 90 |
+
- -1
|
| 91 |
+
- -1
|
| 92 |
+
- -1
|
| 93 |
+
- -1
|
| 94 |
+
- 4
|
| 95 |
+
- 4
|
| 96 |
+
- 4
|
| 97 |
+
- 1
|
| 98 |
+
- 1
|
| 99 |
+
- 1
|
| 100 |
+
- 1
|
| 101 |
+
denormalize_for_loss: false
|
| 102 |
+
num_regression_layers: 2
|
| 103 |
+
discretize: true
|
| 104 |
+
bin_num: 256
|
| 105 |
+
my_pretrained_path: output/train_sorted/ckpt_45000/output_dir
|
| 106 |
+
llm_pretrained_path: cache/InternVL3-2B-Instruct
|
| 107 |
+
resume_path: null
|
| 108 |
+
sampling_type: default
|
| 109 |
+
pretrained_config: null
|
| 110 |
+
precision: bf16
|
| 111 |
+
evaluate: true
|
| 112 |
+
conv_type: internvl2_5
|
| 113 |
+
from_start: false
|
| 114 |
+
storage_dir: output/
|
| 115 |
+
log_folder: logs/sorted_ckpt_45000/validation/multimodal
|
train/.hydra/hydra.yaml
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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6 |
+
subdir: ${hydra.job.num}
|
| 7 |
+
launcher:
|
| 8 |
+
_target_: hydra._internal.core_plugins.basic_launcher.BasicLauncher
|
| 9 |
+
sweeper:
|
| 10 |
+
_target_: hydra._internal.core_plugins.basic_sweeper.BasicSweeper
|
| 11 |
+
max_batch_size: null
|
| 12 |
+
params: null
|
| 13 |
+
help:
|
| 14 |
+
app_name: ${hydra.job.name}
|
| 15 |
+
header: '${hydra.help.app_name} is powered by Hydra.
|
| 16 |
+
|
| 17 |
+
'
|
| 18 |
+
footer: 'Powered by Hydra (https://hydra.cc)
|
| 19 |
+
|
| 20 |
+
Use --hydra-help to view Hydra specific help
|
| 21 |
+
|
| 22 |
+
'
|
| 23 |
+
template: '${hydra.help.header}
|
| 24 |
+
|
| 25 |
+
== Configuration groups ==
|
| 26 |
+
|
| 27 |
+
Compose your configuration from those groups (group=option)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
$APP_CONFIG_GROUPS
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
== Config ==
|
| 34 |
+
|
| 35 |
+
Override anything in the config (foo.bar=value)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
$CONFIG
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
${hydra.help.footer}
|
| 42 |
+
|
| 43 |
+
'
|
| 44 |
+
hydra_help:
|
| 45 |
+
template: 'Hydra (${hydra.runtime.version})
|
| 46 |
+
|
| 47 |
+
See https://hydra.cc for more info.
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
== Flags ==
|
| 51 |
+
|
| 52 |
+
$FLAGS_HELP
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
== Configuration groups ==
|
| 56 |
+
|
| 57 |
+
Compose your configuration from those groups (For example, append hydra/job_logging=disabled
|
| 58 |
+
to command line)
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
$HYDRA_CONFIG_GROUPS
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
Use ''--cfg hydra'' to Show the Hydra config.
|
| 65 |
+
|
| 66 |
+
'
|
| 67 |
+
hydra_help: ???
|
| 68 |
+
hydra_logging:
|
| 69 |
+
version: 1
|
| 70 |
+
formatters:
|
| 71 |
+
simple:
|
| 72 |
+
format: '[%(asctime)s][HYDRA] %(message)s'
|
| 73 |
+
handlers:
|
| 74 |
+
console:
|
| 75 |
+
class: logging.StreamHandler
|
| 76 |
+
formatter: simple
|
| 77 |
+
stream: ext://sys.stdout
|
| 78 |
+
root:
|
| 79 |
+
level: INFO
|
| 80 |
+
handlers:
|
| 81 |
+
- console
|
| 82 |
+
loggers:
|
| 83 |
+
logging_example:
|
| 84 |
+
level: DEBUG
|
| 85 |
+
disable_existing_loggers: false
|
| 86 |
+
job_logging:
|
| 87 |
+
version: 1
|
| 88 |
+
formatters:
|
| 89 |
+
simple:
|
| 90 |
+
format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s'
|
| 91 |
+
handlers:
|
| 92 |
+
console:
|
| 93 |
+
class: logging.StreamHandler
|
| 94 |
+
formatter: simple
|
| 95 |
+
stream: ext://sys.stdout
|
| 96 |
+
file:
|
| 97 |
+
class: logging.FileHandler
|
| 98 |
+
formatter: simple
|
| 99 |
+
filename: ${hydra.runtime.output_dir}/${hydra.job.name}.log
|
| 100 |
+
root:
|
| 101 |
+
level: INFO
|
| 102 |
+
handlers:
|
| 103 |
+
- console
|
| 104 |
+
- file
|
| 105 |
+
disable_existing_loggers: false
|
| 106 |
+
env: {}
|
| 107 |
+
mode: RUN
|
| 108 |
+
searchpath: []
|
| 109 |
+
callbacks: {}
|
| 110 |
+
output_subdir: .hydra
|
| 111 |
+
overrides:
|
| 112 |
+
hydra:
|
| 113 |
+
- hydra.mode=RUN
|
| 114 |
+
task:
|
| 115 |
+
- experiment.project_name=AIpparel
|
| 116 |
+
- experiment.run_name=eval_multimodal
|
| 117 |
+
- my_pretrained_path=output/train_sorted/ckpt_45000/output_dir
|
| 118 |
+
- evaluate=True
|
| 119 |
+
- +log_folder=logs/sorted_ckpt_45000/validation/multimodal
|
| 120 |
+
job:
|
| 121 |
+
name: run_inference
|
| 122 |
+
chdir: null
|
| 123 |
+
override_dirname: +log_folder=logs/sorted_ckpt_45000/validation/multimodal,evaluate=True,experiment.project_name=AIpparel,experiment.run_name=eval_multimodal,my_pretrained_path=output/train_sorted/ckpt_45000/output_dir
|
| 124 |
+
id: ???
|
| 125 |
+
num: ???
|
| 126 |
+
config_name: aipparel_inference
|
| 127 |
+
env_set: {}
|
| 128 |
+
env_copy: []
|
| 129 |
+
config:
|
| 130 |
+
override_dirname:
|
| 131 |
+
kv_sep: '='
|
| 132 |
+
item_sep: ','
|
| 133 |
+
exclude_keys: []
|
| 134 |
+
runtime:
|
| 135 |
+
version: 1.3.2
|
| 136 |
+
version_base: '1.3'
|
| 137 |
+
cwd: /root/workspace/SwiftTailor3
|
| 138 |
+
config_sources:
|
| 139 |
+
- path: hydra.conf
|
| 140 |
+
schema: pkg
|
| 141 |
+
provider: hydra
|
| 142 |
+
- path: /root/workspace/SwiftTailor3/configs
|
| 143 |
+
schema: file
|
| 144 |
+
provider: main
|
| 145 |
+
- path: ''
|
| 146 |
+
schema: structured
|
| 147 |
+
provider: schema
|
| 148 |
+
output_dir: /root/workspace/SwiftTailor3/output/train
|
| 149 |
+
choices:
|
| 150 |
+
model: aipparel_model
|
| 151 |
+
experiment: experiment
|
| 152 |
+
experiment/wandb_info: wandb
|
| 153 |
+
trainer: trainer
|
| 154 |
+
data_wrapper: gcd_datawrapper
|
| 155 |
+
data_wrapper/dataset: gcd_mm
|
| 156 |
+
data_wrapper/dataset/garment_tokenizer: gcd_garment_tokenizer
|
| 157 |
+
data_wrapper/dataset/garment_tokenizer/standardize: gcd_stats
|
| 158 |
+
data_wrapper/dataset/garment_tokenizer/standardize/vertices: gcd_verts_stats
|
| 159 |
+
data_wrapper/dataset/garment_tokenizer/standardize/translations: gcd_transl_stats
|
| 160 |
+
data_wrapper/dataset/garment_tokenizer/standardize/rotations: gcd_rotation_stats
|
| 161 |
+
hydra/env: default
|
| 162 |
+
hydra/callbacks: null
|
| 163 |
+
hydra/job_logging: default
|
| 164 |
+
hydra/hydra_logging: default
|
| 165 |
+
hydra/hydra_help: default
|
| 166 |
+
hydra/help: default
|
| 167 |
+
hydra/sweeper: basic
|
| 168 |
+
hydra/launcher: basic
|
| 169 |
+
hydra/output: default
|
| 170 |
+
verbose: false
|
| 171 |
+
lt
|
| 172 |
+
verbose: false
|
| 173 |
+
false
|
train/.hydra/overrides.yaml
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- experiment.project_name=AIpparel
|
| 2 |
+
- experiment.run_name=eval_multimodal
|
| 3 |
+
- my_pretrained_path=output/train_sorted/ckpt_45000/output_dir
|
| 4 |
+
- evaluate=True
|
| 5 |
+
- +log_folder=logs/sorted_ckpt_45000/validation/multimodal
|
train/ckpt_49999/global_step50000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:852e9d8872c0b4285e67bf91a47911d2766766a9ad74af8c455eddb98746c79a
|
| 3 |
+
size 5358433456
|
train/ckpt_49999/global_step50000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db6b58246964fee6e54baf463f9ab51b9f4a5dc291fda70ab2997b1d2adc9dba
|
| 3 |
+
size 5358437808
|
train/ckpt_49999/global_step50000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c2c3c858730e4a3ad0b7497c387aa2428153bb84b2fe9cd66d15d57cb8b60f42
|
| 3 |
+
size 5358438768
|
train/ckpt_49999/global_step50000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dc987ea3a85836f0684ce8429b9c036924e16780b9fa4bb09fc13f73dc140234
|
| 3 |
+
size 5358432112
|
train/ckpt_49999/global_step50000/mp_rank_00_model_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d2ee201f096e672d3461ed7b8614a7ffcaceb0e676e1f0bb0000c52cbed28c41
|
| 3 |
+
size 4823376020
|
train/ckpt_49999/latest
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
global_step50000
|
train/ckpt_49999/output_dir/config.json
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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oConfig": "configuration_internvl_chat.InternVLChatConfig",
|
| 9 |
+
"AutoModel": "modeling_internvl_chat.InternVLChatModel",
|
| 10 |
+
"AutoModelForCausalLM": "modeling_internvl_chat.InternVLChatModel"
|
| 11 |
+
},
|
| 12 |
+
"downsample_ratio": 0.5,
|
| 13 |
+
"dynamic_image_size": true,
|
| 14 |
+
"force_image_size": 448,
|
| 15 |
+
"image_fold": null,
|
| 16 |
+
"llm_config": {
|
| 17 |
+
"_name_or_path": "./pretrained/Qwen2.5-32B-Instruct",
|
| 18 |
+
"add_cross_attention": false,
|
| 19 |
+
"architectures": [
|
| 20 |
+
"Qwen2ForCausalLM"
|
| 21 |
+
],
|
| 22 |
+
"attention_dropout": 0.0,
|
| 23 |
+
"bad_words_ids": null,
|
| 24 |
+
"begin_suppress_tokens": null,
|
| 25 |
+
"bos_token_id": 151643,
|
| 26 |
+
"chunk_size_feed_forward": 0,
|
| 27 |
+
"cross_attention_hidden_size": null,
|
| 28 |
+
"decoder_start_token_id": null,
|
| 29 |
+
"diversity_penalty": 0.0,
|
| 30 |
+
"do_sample": false,
|
| 31 |
+
"early_stopping": false,
|
| 32 |
+
"encoder_no_repeat_ngram_size": 0,
|
| 33 |
+
"eos_token_id": 151643,
|
| 34 |
+
"exponential_decay_length_penalty": null,
|
| 35 |
+
"finetuning_task": null,
|
| 36 |
+
"forced_bos_token_id": null,
|
| 37 |
+
"forced_eos_token_id": null,
|
| 38 |
+
"hidden_act": "silu",
|
| 39 |
+
"hidden_size": 1536,
|
| 40 |
+
"id2label": {
|
| 41 |
+
"0": "LABEL_0",
|
| 42 |
+
"1": "LABEL_1"
|
| 43 |
+
},
|
| 44 |
+
"initializer_range": 0.02,
|
| 45 |
+
"intermediate_size": 8960,
|
| 46 |
+
"is_decoder": false,
|
| 47 |
+
"is_encoder_decoder": false,
|
| 48 |
+
"label2id": {
|
| 49 |
+
"LABEL_0": 0,
|
| 50 |
+
"LABEL_1": 1
|
| 51 |
+
},
|
| 52 |
+
"length_penalty": 1.0,
|
| 53 |
+
"max_length": 20,
|
| 54 |
+
"max_position_embeddings": 32768,
|
| 55 |
+
"max_window_layers": 70,
|
| 56 |
+
"min_length": 0,
|
| 57 |
+
"model_type": "qwen2",
|
| 58 |
+
"moe_config": null,
|
| 59 |
+
"no_repeat_ngram_size": 0,
|
| 60 |
+
"num_attention_heads": 12,
|
| 61 |
+
"num_beam_groups": 1,
|
| 62 |
+
"num_beams": 1,
|
| 63 |
+
"num_hidden_layers": 28,
|
| 64 |
+
"num_key_value_heads": 2,
|
| 65 |
+
"num_return_sequences": 1,
|
| 66 |
+
"output_attentions": false,
|
| 67 |
+
"output_hidden_states": false,
|
| 68 |
+
"output_scores": false,
|
| 69 |
+
"pad_token_id": null,
|
| 70 |
+
"prefix": null,
|
| 71 |
+
"problem_type": null,
|
| 72 |
+
"pruned_heads": {},
|
| 73 |
+
"remove_invalid_values": false,
|
| 74 |
+
"repetition_penalty": 1.0,
|
| 75 |
+
"return_dict": true,
|
| 76 |
+
"return_dict_in_generate": false,
|
| 77 |
+
"rms_norm_eps": 1e-06,
|
| 78 |
+
"rope_scaling": {
|
| 79 |
+
"factor": 2.0,
|
| 80 |
+
"rope_type": "dynamic",
|
| 81 |
+
"type": "dynamic"
|
| 82 |
+
},
|
| 83 |
+
"rope_theta": 1000000.0,
|
| 84 |
+
"sep_token_id": null,
|
| 85 |
+
"sliding_window": null,
|
| 86 |
+
"suppress_tokens": null,
|
| 87 |
+
"task_specific_params": null,
|
| 88 |
+
"temperature": 1.0,
|
| 89 |
+
"tf_legacy_loss": false,
|
| 90 |
+
"tie_encoder_decoder": false,
|
| 91 |
+
"tie_word_embeddings": false,
|
| 92 |
+
"tokenizer_class": null,
|
| 93 |
+
"top_k": 50,
|
| 94 |
+
"top_p": 1.0,
|
| 95 |
+
"torch_dtype": "bfloat16",
|
| 96 |
+
"torchscript": false,
|
| 97 |
+
"transformers_version": "4.45.1",
|
| 98 |
+
"typical_p": 1.0,
|
| 99 |
+
"use_bfloat16": true,
|
| 100 |
+
"use_cache": true,
|
| 101 |
+
"use_sliding_window": false,
|
| 102 |
+
"vocab_size": 151796
|
| 103 |
+
},
|
| 104 |
+
"max_dynamic_patch": 12,
|
| 105 |
+
"min_dynamic_patch": 1,
|
| 106 |
+
"model_type": "internvl_chat",
|
| 107 |
+
"pad2square": false,
|
| 108 |
+
"ps_version": "v2",
|
| 109 |
+
"select_layer": -1,
|
| 110 |
+
"template": "internvl2_5",
|
| 111 |
+
"tie_word_embeddings": false,
|
| 112 |
+
"torch_dtype": "bfloat16",
|
| 113 |
+
"transformers_version": null,
|
| 114 |
+
"use_backbone_lora": 0,
|
| 115 |
+
"use_llm_lora": 0,
|
| 116 |
+
"use_thumbnail": true,
|
| 117 |
+
"vision_config": {
|
| 118 |
+
"_name_or_path": "OpenGVLab/InternViT-6B-448px-V1-5",
|
| 119 |
+
"add_cross_attention": false,
|
| 120 |
+
"architectures": [
|
| 121 |
+
"InternVisionModel"
|
| 122 |
+
],
|
| 123 |
+
"attention_dropout": 0.0,
|
| 124 |
+
"auto_map": {
|
| 125 |
+
"AutoConfig": "configuration_intern_vit.InternVisionConfig",
|
| 126 |
+
"AutoModel": "modeling_intern_vit.InternVisionModel"
|
| 127 |
+
},
|
| 128 |
+
"bad_words_ids": null,
|
| 129 |
+
"begin_suppress_tokens": null,
|
| 130 |
+
"bos_token_id": null,
|
| 131 |
+
"capacity_factor": 1.2,
|
| 132 |
+
"chunk_size_feed_forward": 0,
|
| 133 |
+
"cross_attention_hidden_size": null,
|
| 134 |
+
"decoder_start_token_id": null,
|
| 135 |
+
"diversity_penalty": 0.0,
|
| 136 |
+
"do_sample": false,
|
| 137 |
+
"drop_path_rate": 0.0,
|
| 138 |
+
"dropout": 0.0,
|
| 139 |
+
"early_stopping": false,
|
| 140 |
+
"encoder_no_repeat_ngram_size": 0,
|
| 141 |
+
"eos_token_id": null,
|
| 142 |
+
"eval_capacity_factor": 1.4,
|
| 143 |
+
"exponential_decay_length_penalty": null,
|
| 144 |
+
"finetuning_task": null,
|
| 145 |
+
"forced_bos_token_id": null,
|
| 146 |
+
"forced_eos_token_id": null,
|
| 147 |
+
"hidden_act": "gelu",
|
| 148 |
+
"hidden_size": 1024,
|
| 149 |
+
"id2label": {
|
| 150 |
+
"0": "LABEL_0",
|
| 151 |
+
"1": "LABEL_1"
|
| 152 |
+
},
|
| 153 |
+
"image_size": 448,
|
| 154 |
+
"initializer_factor": 0.1,
|
| 155 |
+
"initializer_range": 1e-10,
|
| 156 |
+
"intermediate_size": 4096,
|
| 157 |
+
"is_decoder": false,
|
| 158 |
+
"is_encoder_decoder": false,
|
| 159 |
+
"label2id": {
|
| 160 |
+
"LABEL_0": 0,
|
| 161 |
+
"LABEL_1": 1
|
| 162 |
+
},
|
| 163 |
+
"laux_allreduce": "all_nodes",
|
| 164 |
+
"layer_norm_eps": 1e-06,
|
| 165 |
+
"length_penalty": 1.0,
|
| 166 |
+
"max_length": 20,
|
| 167 |
+
"min_length": 0,
|
| 168 |
+
"model_type": "intern_vit_6b",
|
| 169 |
+
"moe_coeff_ratio": 0.5,
|
| 170 |
+
"moe_intermediate_size": 768,
|
| 171 |
+
"moe_output_scale": 4.0,
|
| 172 |
+
"no_repeat_ngram_size": 0,
|
| 173 |
+
"noisy_gate_policy": "RSample_before",
|
| 174 |
+
"norm_type": "layer_norm",
|
| 175 |
+
"num_attention_heads": 16,
|
| 176 |
+
"num_beam_groups": 1,
|
| 177 |
+
"num_beams": 1,
|
| 178 |
+
"num_channels": 3,
|
| 179 |
+
"num_experts": 8,
|
| 180 |
+
"num_hidden_layers": 24,
|
| 181 |
+
"num_return_sequences": 1,
|
| 182 |
+
"num_routed_experts": 4,
|
| 183 |
+
"num_shared_experts": 4,
|
| 184 |
+
"output_attentions": false,
|
| 185 |
+
"output_hidden_states": false,
|
| 186 |
+
"output_scores": false,
|
| 187 |
+
"pad_token_id": null,
|
| 188 |
+
"patch_size": 14,
|
| 189 |
+
"prefix": null,
|
| 190 |
+
"problem_type": null,
|
| 191 |
+
"pruned_heads": {},
|
| 192 |
+
"qk_normalization": false,
|
| 193 |
+
"qkv_bias": true,
|
| 194 |
+
"remove_invalid_values": false,
|
| 195 |
+
"repetition_penalty": 1.0,
|
| 196 |
+
"return_dict": true,
|
| 197 |
+
"return_dict_in_generate": false,
|
| 198 |
+
"sep_token_id": null,
|
| 199 |
+
"shared_expert_intermediate_size": 3072,
|
| 200 |
+
"suppress_tokens": null,
|
| 201 |
+
"task_specific_params": null,
|
| 202 |
+
"temperature": 1.0,
|
| 203 |
+
"tf_legacy_loss": false,
|
| 204 |
+
"tie_encoder_decoder": false,
|
| 205 |
+
"tie_word_embeddings": true,
|
| 206 |
+
"tokenizer_class": null,
|
| 207 |
+
"top_k": 50,
|
| 208 |
+
"top_p": 1.0,
|
| 209 |
+
"torch_dtype": "bfloat16",
|
| 210 |
+
"torchscript": false,
|
| 211 |
+
"transformers_version": "4.45.1",
|
| 212 |
+
"typical_p": 1.0,
|
| 213 |
+
"use_bfloat16": true,
|
| 214 |
+
"use_flash_attn": true,
|
| 215 |
+
"use_moe": false,
|
| 216 |
+
"use_residual": true,
|
| 217 |
+
"use_rts": false,
|
| 218 |
+
"use_weighted_residual": false
|
| 219 |
+
}
|
| 220 |
+
}
|
train/ckpt_49999/output_dir/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d5d5ccfc0141297d3011b8359974000407aaf37f7a1ad5c0f07872303c00374f
|
| 3 |
+
size 7770003116
|
train/ckpt_49999/zero_to_fp32.py
ADDED
|
@@ -0,0 +1,760 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python
|
| 2 |
+
|
| 3 |
+
# Copyright (c) Microsoft Corporation.
|
| 4 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 5 |
+
|
| 6 |
+
# DeepSpeed Team
|
| 7 |
+
|
| 8 |
+
# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
|
| 9 |
+
# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
|
| 10 |
+
# the future. Once extracted, the weights don't require DeepSpeed and can be used in any
|
| 11 |
+
# application.
|
| 12 |
+
#
|
| 13 |
+
# example:
|
| 14 |
+
# python zero_to_fp32.py . output_dir/
|
| 15 |
+
# or
|
| 16 |
+
# python zero_to_fp32.py . output_dir/ --safe_serialization
|
| 17 |
+
|
| 18 |
+
import argparse
|
| 19 |
+
import torch
|
| 20 |
+
import glob
|
| 21 |
+
import math
|
| 22 |
+
import os
|
| 23 |
+
import re
|
| 24 |
+
import gc
|
| 25 |
+
import json
|
| 26 |
+
import numpy as np
|
| 27 |
+
from tqdm import tqdm
|
| 28 |
+
from collections import OrderedDict
|
| 29 |
+
from dataclasses import dataclass
|
| 30 |
+
|
| 31 |
+
# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
|
| 32 |
+
# DeepSpeed data structures it has to be available in the current python environment.
|
| 33 |
+
from deepspeed.utils import logger
|
| 34 |
+
from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
|
| 35 |
+
FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
|
| 36 |
+
FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS)
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
@dataclass
|
| 40 |
+
class zero_model_state:
|
| 41 |
+
buffers: dict()
|
| 42 |
+
param_shapes: dict()
|
| 43 |
+
shared_params: list
|
| 44 |
+
ds_version: int
|
| 45 |
+
frozen_param_shapes: dict()
|
| 46 |
+
frozen_param_fragments: dict()
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
debug = 0
|
| 50 |
+
|
| 51 |
+
# load to cpu
|
| 52 |
+
device = torch.device('cpu')
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
def atoi(text):
|
| 56 |
+
return int(text) if text.isdigit() else text
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
def natural_keys(text):
|
| 60 |
+
'''
|
| 61 |
+
alist.sort(key=natural_keys) sorts in human order
|
| 62 |
+
http://nedbatchelder.com/blog/200712/human_sorting.html
|
| 63 |
+
(See Toothy's implementation in the comments)
|
| 64 |
+
'''
|
| 65 |
+
return [atoi(c) for c in re.split(r'(\d+)', text)]
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def get_model_state_file(checkpoint_dir, zero_stage):
|
| 69 |
+
if not os.path.isdir(checkpoint_dir):
|
| 70 |
+
raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
|
| 71 |
+
|
| 72 |
+
# there should be only one file
|
| 73 |
+
if zero_stage <= 2:
|
| 74 |
+
file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
|
| 75 |
+
elif zero_stage == 3:
|
| 76 |
+
file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
|
| 77 |
+
|
| 78 |
+
if not os.path.exists(file):
|
| 79 |
+
raise FileNotFoundError(f"can't find model states file at '{file}'")
|
| 80 |
+
|
| 81 |
+
return file
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
def get_checkpoint_files(checkpoint_dir, glob_pattern):
|
| 85 |
+
# XXX: need to test that this simple glob rule works for multi-node setup too
|
| 86 |
+
ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
|
| 87 |
+
|
| 88 |
+
if len(ckpt_files) == 0:
|
| 89 |
+
raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
|
| 90 |
+
|
| 91 |
+
return ckpt_files
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def get_optim_files(checkpoint_dir):
|
| 95 |
+
return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
def get_model_state_files(checkpoint_dir):
|
| 99 |
+
return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
def parse_model_states(files):
|
| 103 |
+
zero_model_states = []
|
| 104 |
+
for file in files:
|
| 105 |
+
state_dict = torch.load(file, map_location=device, weights_only=False)
|
| 106 |
+
|
| 107 |
+
if BUFFER_NAMES not in state_dict:
|
| 108 |
+
raise ValueError(f"{file} is not a model state checkpoint")
|
| 109 |
+
buffer_names = state_dict[BUFFER_NAMES]
|
| 110 |
+
if debug:
|
| 111 |
+
print("Found buffers:", buffer_names)
|
| 112 |
+
|
| 113 |
+
# recover just the buffers while restoring them to fp32 if they were saved in fp16
|
| 114 |
+
buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
|
| 115 |
+
param_shapes = state_dict[PARAM_SHAPES]
|
| 116 |
+
|
| 117 |
+
# collect parameters that are included in param_shapes
|
| 118 |
+
param_names = []
|
| 119 |
+
for s in param_shapes:
|
| 120 |
+
for name in s.keys():
|
| 121 |
+
param_names.append(name)
|
| 122 |
+
|
| 123 |
+
# update with frozen parameters
|
| 124 |
+
frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
|
| 125 |
+
if frozen_param_shapes is not None:
|
| 126 |
+
if debug:
|
| 127 |
+
print(f"Found frozen_param_shapes: {frozen_param_shapes}")
|
| 128 |
+
param_names += list(frozen_param_shapes.keys())
|
| 129 |
+
|
| 130 |
+
# handle shared params
|
| 131 |
+
shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
|
| 132 |
+
|
| 133 |
+
ds_version = state_dict.get(DS_VERSION, None)
|
| 134 |
+
|
| 135 |
+
frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
|
| 136 |
+
|
| 137 |
+
z_model_state = zero_model_state(buffers=buffers,
|
| 138 |
+
param_shapes=param_shapes,
|
| 139 |
+
shared_params=shared_params,
|
| 140 |
+
ds_version=ds_version,
|
| 141 |
+
frozen_param_shapes=frozen_param_shapes,
|
| 142 |
+
frozen_param_fragments=frozen_param_fragments)
|
| 143 |
+
zero_model_states.append(z_model_state)
|
| 144 |
+
|
| 145 |
+
return zero_model_states
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
def parse_optim_states(files, ds_checkpoint_dir):
|
| 149 |
+
total_files = len(files)
|
| 150 |
+
state_dicts = []
|
| 151 |
+
for f in tqdm(files, desc='Loading checkpoint shards'):
|
| 152 |
+
state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False)
|
| 153 |
+
# immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
|
| 154 |
+
# and also handle the case where it was already removed by another helper script
|
| 155 |
+
state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
|
| 156 |
+
state_dicts.append(state_dict)
|
| 157 |
+
|
| 158 |
+
if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]:
|
| 159 |
+
raise ValueError(f"{files[0]} is not a zero checkpoint")
|
| 160 |
+
zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
|
| 161 |
+
world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
|
| 162 |
+
|
| 163 |
+
# For ZeRO-2 each param group can have different partition_count as data parallelism for expert
|
| 164 |
+
# parameters can be different from data parallelism for non-expert parameters. So we can just
|
| 165 |
+
# use the max of the partition_count to get the dp world_size.
|
| 166 |
+
|
| 167 |
+
if type(world_size) is list:
|
| 168 |
+
world_size = max(world_size)
|
| 169 |
+
|
| 170 |
+
if world_size != total_files:
|
| 171 |
+
raise ValueError(
|
| 172 |
+
f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
|
| 173 |
+
"Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
|
| 174 |
+
)
|
| 175 |
+
|
| 176 |
+
# the groups are named differently in each stage
|
| 177 |
+
if zero_stage <= 2:
|
| 178 |
+
fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
|
| 179 |
+
elif zero_stage == 3:
|
| 180 |
+
fp32_groups_key = FP32_FLAT_GROUPS
|
| 181 |
+
else:
|
| 182 |
+
raise ValueError(f"unknown zero stage {zero_stage}")
|
| 183 |
+
|
| 184 |
+
fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
|
| 185 |
+
return zero_stage, world_size, fp32_flat_groups
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
|
| 189 |
+
"""
|
| 190 |
+
Returns fp32 state_dict reconstructed from ds checkpoint
|
| 191 |
+
|
| 192 |
+
Args:
|
| 193 |
+
- ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
|
| 194 |
+
|
| 195 |
+
"""
|
| 196 |
+
print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
|
| 197 |
+
|
| 198 |
+
optim_files = get_optim_files(ds_checkpoint_dir)
|
| 199 |
+
zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
|
| 200 |
+
print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
|
| 201 |
+
|
| 202 |
+
model_files = get_model_state_files(ds_checkpoint_dir)
|
| 203 |
+
|
| 204 |
+
zero_model_states = parse_model_states(model_files)
|
| 205 |
+
print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
|
| 206 |
+
|
| 207 |
+
if zero_stage <= 2:
|
| 208 |
+
return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 209 |
+
exclude_frozen_parameters)
|
| 210 |
+
elif zero_stage == 3:
|
| 211 |
+
return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 212 |
+
exclude_frozen_parameters)
|
| 213 |
+
|
| 214 |
+
|
| 215 |
+
def _zero2_merge_frozen_params(state_dict, zero_model_states):
|
| 216 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
| 217 |
+
return
|
| 218 |
+
|
| 219 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
| 220 |
+
frozen_param_fragments = zero_model_states[0].frozen_param_fragments
|
| 221 |
+
|
| 222 |
+
if debug:
|
| 223 |
+
num_elem = sum(s.numel() for s in frozen_param_shapes.values())
|
| 224 |
+
print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
| 225 |
+
|
| 226 |
+
wanted_params = len(frozen_param_shapes)
|
| 227 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
| 228 |
+
avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
|
| 229 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
| 230 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
| 231 |
+
|
| 232 |
+
total_params = 0
|
| 233 |
+
total_numel = 0
|
| 234 |
+
for name, shape in frozen_param_shapes.items():
|
| 235 |
+
total_params += 1
|
| 236 |
+
unpartitioned_numel = shape.numel()
|
| 237 |
+
total_numel += unpartitioned_numel
|
| 238 |
+
|
| 239 |
+
state_dict[name] = frozen_param_fragments[name]
|
| 240 |
+
|
| 241 |
+
if debug:
|
| 242 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
| 243 |
+
|
| 244 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
| 245 |
+
|
| 246 |
+
|
| 247 |
+
def _has_callable(obj, fn):
|
| 248 |
+
attr = getattr(obj, fn, None)
|
| 249 |
+
return callable(attr)
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
| 253 |
+
param_shapes = zero_model_states[0].param_shapes
|
| 254 |
+
|
| 255 |
+
# Reconstruction protocol:
|
| 256 |
+
#
|
| 257 |
+
# XXX: document this
|
| 258 |
+
|
| 259 |
+
if debug:
|
| 260 |
+
for i in range(world_size):
|
| 261 |
+
for j in range(len(fp32_flat_groups[0])):
|
| 262 |
+
print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
|
| 263 |
+
|
| 264 |
+
# XXX: memory usage doubles here (zero2)
|
| 265 |
+
num_param_groups = len(fp32_flat_groups[0])
|
| 266 |
+
merged_single_partition_of_fp32_groups = []
|
| 267 |
+
for i in range(num_param_groups):
|
| 268 |
+
merged_partitions = [sd[i] for sd in fp32_flat_groups]
|
| 269 |
+
full_single_fp32_vector = torch.cat(merged_partitions, 0)
|
| 270 |
+
merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
|
| 271 |
+
avail_numel = sum(
|
| 272 |
+
[full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
|
| 273 |
+
|
| 274 |
+
if debug:
|
| 275 |
+
wanted_params = sum([len(shapes) for shapes in param_shapes])
|
| 276 |
+
wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
|
| 277 |
+
# not asserting if there is a mismatch due to possible padding
|
| 278 |
+
print(f"Have {avail_numel} numels to process.")
|
| 279 |
+
print(f"Need {wanted_numel} numels in {wanted_params} params.")
|
| 280 |
+
|
| 281 |
+
# params
|
| 282 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
| 283 |
+
# out-of-core computing solution
|
| 284 |
+
total_numel = 0
|
| 285 |
+
total_params = 0
|
| 286 |
+
for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
|
| 287 |
+
offset = 0
|
| 288 |
+
avail_numel = full_single_fp32_vector.numel()
|
| 289 |
+
for name, shape in shapes.items():
|
| 290 |
+
|
| 291 |
+
unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
|
| 292 |
+
total_numel += unpartitioned_numel
|
| 293 |
+
total_params += 1
|
| 294 |
+
|
| 295 |
+
if debug:
|
| 296 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
| 297 |
+
state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
|
| 298 |
+
offset += unpartitioned_numel
|
| 299 |
+
|
| 300 |
+
# Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
|
| 301 |
+
# avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
|
| 302 |
+
# paddings performed in the code it's almost impossible to predict the exact numbers w/o the
|
| 303 |
+
# live optimizer object, so we are checking that the numbers are within the right range
|
| 304 |
+
align_to = 2 * world_size
|
| 305 |
+
|
| 306 |
+
def zero2_align(x):
|
| 307 |
+
return align_to * math.ceil(x / align_to)
|
| 308 |
+
|
| 309 |
+
if debug:
|
| 310 |
+
print(f"original offset={offset}, avail_numel={avail_numel}")
|
| 311 |
+
|
| 312 |
+
offset = zero2_align(offset)
|
| 313 |
+
avail_numel = zero2_align(avail_numel)
|
| 314 |
+
|
| 315 |
+
if debug:
|
| 316 |
+
print(f"aligned offset={offset}, avail_numel={avail_numel}")
|
| 317 |
+
|
| 318 |
+
# Sanity check
|
| 319 |
+
if offset != avail_numel:
|
| 320 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
| 321 |
+
|
| 322 |
+
print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
|
| 323 |
+
|
| 324 |
+
|
| 325 |
+
def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 326 |
+
exclude_frozen_parameters):
|
| 327 |
+
state_dict = OrderedDict()
|
| 328 |
+
|
| 329 |
+
# buffers
|
| 330 |
+
buffers = zero_model_states[0].buffers
|
| 331 |
+
state_dict.update(buffers)
|
| 332 |
+
if debug:
|
| 333 |
+
print(f"added {len(buffers)} buffers")
|
| 334 |
+
|
| 335 |
+
if not exclude_frozen_parameters:
|
| 336 |
+
_zero2_merge_frozen_params(state_dict, zero_model_states)
|
| 337 |
+
|
| 338 |
+
_zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
| 339 |
+
|
| 340 |
+
# recover shared parameters
|
| 341 |
+
for pair in zero_model_states[0].shared_params:
|
| 342 |
+
if pair[1] in state_dict:
|
| 343 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
| 344 |
+
|
| 345 |
+
return state_dict
|
| 346 |
+
|
| 347 |
+
|
| 348 |
+
def zero3_partitioned_param_info(unpartitioned_numel, world_size):
|
| 349 |
+
remainder = unpartitioned_numel % world_size
|
| 350 |
+
padding_numel = (world_size - remainder) if remainder else 0
|
| 351 |
+
partitioned_numel = math.ceil(unpartitioned_numel / world_size)
|
| 352 |
+
return partitioned_numel, padding_numel
|
| 353 |
+
|
| 354 |
+
|
| 355 |
+
def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
|
| 356 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
| 357 |
+
return
|
| 358 |
+
|
| 359 |
+
if debug:
|
| 360 |
+
for i in range(world_size):
|
| 361 |
+
num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
|
| 362 |
+
print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
| 363 |
+
|
| 364 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
| 365 |
+
wanted_params = len(frozen_param_shapes)
|
| 366 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
| 367 |
+
avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
|
| 368 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
| 369 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
| 370 |
+
|
| 371 |
+
total_params = 0
|
| 372 |
+
total_numel = 0
|
| 373 |
+
for name, shape in zero_model_states[0].frozen_param_shapes.items():
|
| 374 |
+
total_params += 1
|
| 375 |
+
unpartitioned_numel = shape.numel()
|
| 376 |
+
total_numel += unpartitioned_numel
|
| 377 |
+
|
| 378 |
+
param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
|
| 379 |
+
state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
|
| 380 |
+
|
| 381 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
| 382 |
+
|
| 383 |
+
if debug:
|
| 384 |
+
print(
|
| 385 |
+
f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
| 386 |
+
)
|
| 387 |
+
|
| 388 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
| 389 |
+
|
| 390 |
+
|
| 391 |
+
class GatheredTensor:
|
| 392 |
+
"""
|
| 393 |
+
A pseudo tensor that collects partitioned weights.
|
| 394 |
+
It is more memory efficient when there are multiple groups.
|
| 395 |
+
"""
|
| 396 |
+
|
| 397 |
+
def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape):
|
| 398 |
+
self.flat_groups = flat_groups
|
| 399 |
+
self.flat_groups_offset = flat_groups_offset
|
| 400 |
+
self.offset = offset
|
| 401 |
+
self.partitioned_numel = partitioned_numel
|
| 402 |
+
self.shape = shape
|
| 403 |
+
self.dtype = self.flat_groups[0][0].dtype
|
| 404 |
+
|
| 405 |
+
def contiguous(self):
|
| 406 |
+
"""
|
| 407 |
+
Merge partitioned weights from flat_groups into a single tensor.
|
| 408 |
+
"""
|
| 409 |
+
end_idx = self.offset + self.partitioned_numel
|
| 410 |
+
world_size = len(self.flat_groups)
|
| 411 |
+
pad_flat_param_chunks = []
|
| 412 |
+
|
| 413 |
+
for rank_i in range(world_size):
|
| 414 |
+
# for each rank, we need to collect weights from related group/groups
|
| 415 |
+
flat_groups_at_rank_i = self.flat_groups[rank_i]
|
| 416 |
+
start_group_id = None
|
| 417 |
+
end_group_id = None
|
| 418 |
+
for group_id in range(len(self.flat_groups_offset)):
|
| 419 |
+
if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]:
|
| 420 |
+
start_group_id = group_id
|
| 421 |
+
if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]:
|
| 422 |
+
end_group_id = group_id
|
| 423 |
+
break
|
| 424 |
+
# collect weights from related group/groups
|
| 425 |
+
for group_id in range(start_group_id, end_group_id + 1):
|
| 426 |
+
flat_tensor = flat_groups_at_rank_i[group_id]
|
| 427 |
+
start_offset = self.offset - self.flat_groups_offset[group_id]
|
| 428 |
+
end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id]
|
| 429 |
+
pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset])
|
| 430 |
+
|
| 431 |
+
# collect weights from all ranks
|
| 432 |
+
pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0)
|
| 433 |
+
param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous()
|
| 434 |
+
return param
|
| 435 |
+
|
| 436 |
+
|
| 437 |
+
def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
| 438 |
+
param_shapes = zero_model_states[0].param_shapes
|
| 439 |
+
avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size
|
| 440 |
+
|
| 441 |
+
# Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
|
| 442 |
+
# param, re-consolidating each param, while dealing with padding if any
|
| 443 |
+
|
| 444 |
+
# merge list of dicts, preserving order
|
| 445 |
+
param_shapes = {k: v for d in param_shapes for k, v in d.items()}
|
| 446 |
+
|
| 447 |
+
if debug:
|
| 448 |
+
for i in range(world_size):
|
| 449 |
+
print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
|
| 450 |
+
|
| 451 |
+
wanted_params = len(param_shapes)
|
| 452 |
+
wanted_numel = sum(shape.numel() for shape in param_shapes.values())
|
| 453 |
+
# not asserting if there is a mismatch due to possible padding
|
| 454 |
+
avail_numel = fp32_flat_groups[0].numel() * world_size
|
| 455 |
+
print(f"Trainable params: Have {avail_numel} numels to process.")
|
| 456 |
+
print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
|
| 457 |
+
|
| 458 |
+
# params
|
| 459 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
| 460 |
+
# out-of-core computing solution
|
| 461 |
+
offset = 0
|
| 462 |
+
total_numel = 0
|
| 463 |
+
total_params = 0
|
| 464 |
+
flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]]))
|
| 465 |
+
for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'):
|
| 466 |
+
unpartitioned_numel = shape.numel()
|
| 467 |
+
total_numel += unpartitioned_numel
|
| 468 |
+
total_params += 1
|
| 469 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
| 470 |
+
|
| 471 |
+
if debug:
|
| 472 |
+
print(
|
| 473 |
+
f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
| 474 |
+
)
|
| 475 |
+
|
| 476 |
+
# memory efficient tensor
|
| 477 |
+
tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape)
|
| 478 |
+
state_dict[name] = tensor
|
| 479 |
+
offset += partitioned_numel
|
| 480 |
+
|
| 481 |
+
offset *= world_size
|
| 482 |
+
|
| 483 |
+
# Sanity check
|
| 484 |
+
if offset != avail_numel:
|
| 485 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
| 486 |
+
|
| 487 |
+
print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
|
| 488 |
+
|
| 489 |
+
|
| 490 |
+
def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 491 |
+
exclude_frozen_parameters):
|
| 492 |
+
state_dict = OrderedDict()
|
| 493 |
+
|
| 494 |
+
# buffers
|
| 495 |
+
buffers = zero_model_states[0].buffers
|
| 496 |
+
state_dict.update(buffers)
|
| 497 |
+
if debug:
|
| 498 |
+
print(f"added {len(buffers)} buffers")
|
| 499 |
+
|
| 500 |
+
if not exclude_frozen_parameters:
|
| 501 |
+
_zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
|
| 502 |
+
|
| 503 |
+
_zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
| 504 |
+
|
| 505 |
+
# recover shared parameters
|
| 506 |
+
for pair in zero_model_states[0].shared_params:
|
| 507 |
+
if pair[1] in state_dict:
|
| 508 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
| 509 |
+
|
| 510 |
+
return state_dict
|
| 511 |
+
|
| 512 |
+
|
| 513 |
+
def to_torch_tensor(state_dict, return_empty_tensor=False):
|
| 514 |
+
"""
|
| 515 |
+
Convert state_dict of GatheredTensor to torch tensor
|
| 516 |
+
"""
|
| 517 |
+
torch_state_dict = {}
|
| 518 |
+
converted_tensors = {}
|
| 519 |
+
for name, tensor in state_dict.items():
|
| 520 |
+
tensor_id = id(tensor)
|
| 521 |
+
if tensor_id in converted_tensors: # shared tensors
|
| 522 |
+
shared_tensor = torch_state_dict[converted_tensors[tensor_id]]
|
| 523 |
+
torch_state_dict[name] = shared_tensor
|
| 524 |
+
else:
|
| 525 |
+
converted_tensors[tensor_id] = name
|
| 526 |
+
if return_empty_tensor:
|
| 527 |
+
torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype)
|
| 528 |
+
else:
|
| 529 |
+
torch_state_dict[name] = tensor.contiguous()
|
| 530 |
+
return torch_state_dict
|
| 531 |
+
|
| 532 |
+
|
| 533 |
+
def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
|
| 534 |
+
tag=None,
|
| 535 |
+
exclude_frozen_parameters=False,
|
| 536 |
+
lazy_mode=False):
|
| 537 |
+
"""
|
| 538 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
|
| 539 |
+
``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
|
| 540 |
+
via a model hub.
|
| 541 |
+
|
| 542 |
+
Args:
|
| 543 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder
|
| 544 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
|
| 545 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
| 546 |
+
- ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient.
|
| 547 |
+
Convert the pesduo tensor to torch tensor by ``.contiguous()``
|
| 548 |
+
|
| 549 |
+
Returns:
|
| 550 |
+
- pytorch ``state_dict``
|
| 551 |
+
|
| 552 |
+
A typical usage might be ::
|
| 553 |
+
|
| 554 |
+
from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
|
| 555 |
+
# do the training and checkpoint saving
|
| 556 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
|
| 557 |
+
model = model.cpu() # move to cpu
|
| 558 |
+
model.load_state_dict(state_dict)
|
| 559 |
+
# submit to model hub or save the model to share with others
|
| 560 |
+
|
| 561 |
+
In this example the ``model`` will no longer be usable in the deepspeed context of the same
|
| 562 |
+
application. i.e. you will need to re-initialize the deepspeed engine, since
|
| 563 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
| 564 |
+
|
| 565 |
+
If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
|
| 566 |
+
|
| 567 |
+
Note: the above usage may not work if your application doesn't have sufficient free CPU memory.
|
| 568 |
+
You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
|
| 569 |
+
the checkpoint. Or you can load state_dict in lazy mode ::
|
| 570 |
+
|
| 571 |
+
from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
|
| 572 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu
|
| 573 |
+
for name, lazy_tensor in state_dict.item():
|
| 574 |
+
tensor = lazy_tensor.contiguous() # to cpu
|
| 575 |
+
print(name, tensor)
|
| 576 |
+
# del tensor to release memory if it no longer in use
|
| 577 |
+
"""
|
| 578 |
+
if tag is None:
|
| 579 |
+
latest_path = os.path.join(checkpoint_dir, 'latest')
|
| 580 |
+
if os.path.isfile(latest_path):
|
| 581 |
+
with open(latest_path, 'r') as fd:
|
| 582 |
+
tag = fd.read().strip()
|
| 583 |
+
else:
|
| 584 |
+
raise ValueError(f"Unable to find 'latest' file at {latest_path}")
|
| 585 |
+
|
| 586 |
+
ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
|
| 587 |
+
|
| 588 |
+
if not os.path.isdir(ds_checkpoint_dir):
|
| 589 |
+
raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
|
| 590 |
+
|
| 591 |
+
state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
|
| 592 |
+
if lazy_mode:
|
| 593 |
+
return state_dict
|
| 594 |
+
else:
|
| 595 |
+
return to_torch_tensor(state_dict)
|
| 596 |
+
|
| 597 |
+
|
| 598 |
+
def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
|
| 599 |
+
output_dir,
|
| 600 |
+
max_shard_size="5GB",
|
| 601 |
+
safe_serialization=False,
|
| 602 |
+
tag=None,
|
| 603 |
+
exclude_frozen_parameters=False):
|
| 604 |
+
"""
|
| 605 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
|
| 606 |
+
loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
|
| 607 |
+
|
| 608 |
+
Args:
|
| 609 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
| 610 |
+
- ``output_dir``: directory to the pytorch fp32 state_dict output files
|
| 611 |
+
- ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
|
| 612 |
+
- ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
|
| 613 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
| 614 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
| 615 |
+
"""
|
| 616 |
+
|
| 617 |
+
# Dependency pre-check
|
| 618 |
+
if safe_serialization:
|
| 619 |
+
try:
|
| 620 |
+
from safetensors.torch import save_file
|
| 621 |
+
except ImportError:
|
| 622 |
+
print('If you want to use `safe_serialization`, please `pip install safetensors`')
|
| 623 |
+
raise
|
| 624 |
+
if max_shard_size is not None:
|
| 625 |
+
try:
|
| 626 |
+
from huggingface_hub import split_torch_state_dict_into_shards
|
| 627 |
+
except ImportError:
|
| 628 |
+
print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
|
| 629 |
+
raise
|
| 630 |
+
|
| 631 |
+
# Convert zero checkpoint to state_dict
|
| 632 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
|
| 633 |
+
tag,
|
| 634 |
+
exclude_frozen_parameters,
|
| 635 |
+
lazy_mode=True)
|
| 636 |
+
|
| 637 |
+
# Shard the model if it is too big.
|
| 638 |
+
weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
|
| 639 |
+
if max_shard_size is not None:
|
| 640 |
+
filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
|
| 641 |
+
# an memory-efficient approach for sharding
|
| 642 |
+
empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True)
|
| 643 |
+
state_dict_split = split_torch_state_dict_into_shards(empty_state_dict,
|
| 644 |
+
filename_pattern=filename_pattern,
|
| 645 |
+
max_shard_size=max_shard_size)
|
| 646 |
+
else:
|
| 647 |
+
from collections import namedtuple
|
| 648 |
+
StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
|
| 649 |
+
state_dict_split = StateDictSplit(is_sharded=False,
|
| 650 |
+
filename_to_tensors={weights_name: list(state_dict.keys())})
|
| 651 |
+
|
| 652 |
+
# Save the model by shard
|
| 653 |
+
os.makedirs(output_dir, exist_ok=True)
|
| 654 |
+
filename_to_tensors = state_dict_split.filename_to_tensors.items()
|
| 655 |
+
for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
|
| 656 |
+
shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors}
|
| 657 |
+
shard_state_dict = to_torch_tensor(shard_state_dict)
|
| 658 |
+
output_path = os.path.join(output_dir, shard_file)
|
| 659 |
+
if safe_serialization:
|
| 660 |
+
save_file(shard_state_dict, output_path, metadata={"format": "pt"})
|
| 661 |
+
else:
|
| 662 |
+
torch.save(shard_state_dict, output_path)
|
| 663 |
+
# release the memory of current shard
|
| 664 |
+
for tensor_name in list(shard_state_dict.keys()):
|
| 665 |
+
del state_dict[tensor_name]
|
| 666 |
+
del shard_state_dict[tensor_name]
|
| 667 |
+
del shard_state_dict
|
| 668 |
+
gc.collect()
|
| 669 |
+
|
| 670 |
+
# Save index if sharded
|
| 671 |
+
if state_dict_split.is_sharded:
|
| 672 |
+
index = {
|
| 673 |
+
"metadata": state_dict_split.metadata,
|
| 674 |
+
"weight_map": state_dict_split.tensor_to_filename,
|
| 675 |
+
}
|
| 676 |
+
save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
|
| 677 |
+
save_index_file = os.path.join(output_dir, save_index_file)
|
| 678 |
+
with open(save_index_file, "w", encoding="utf-8") as f:
|
| 679 |
+
content = json.dumps(index, indent=2, sort_keys=True) + "\n"
|
| 680 |
+
f.write(content)
|
| 681 |
+
|
| 682 |
+
|
| 683 |
+
def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
|
| 684 |
+
"""
|
| 685 |
+
1. Put the provided model to cpu
|
| 686 |
+
2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
|
| 687 |
+
3. Load it into the provided model
|
| 688 |
+
|
| 689 |
+
Args:
|
| 690 |
+
- ``model``: the model object to update
|
| 691 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
| 692 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
| 693 |
+
|
| 694 |
+
Returns:
|
| 695 |
+
- ``model`: modified model
|
| 696 |
+
|
| 697 |
+
Make sure you have plenty of CPU memory available before you call this function. If you don't
|
| 698 |
+
have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
|
| 699 |
+
conveniently placed for you in the checkpoint folder.
|
| 700 |
+
|
| 701 |
+
A typical usage might be ::
|
| 702 |
+
|
| 703 |
+
from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
|
| 704 |
+
model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
|
| 705 |
+
# submit to model hub or save the model to share with others
|
| 706 |
+
|
| 707 |
+
Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
|
| 708 |
+
of the same application. i.e. you will need to re-initialize the deepspeed engine, since
|
| 709 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
| 710 |
+
|
| 711 |
+
"""
|
| 712 |
+
logger.info(f"Extracting fp32 weights")
|
| 713 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
|
| 714 |
+
|
| 715 |
+
logger.info(f"Overwriting model with fp32 weights")
|
| 716 |
+
model = model.cpu()
|
| 717 |
+
model.load_state_dict(state_dict, strict=False)
|
| 718 |
+
|
| 719 |
+
return model
|
| 720 |
+
|
| 721 |
+
|
| 722 |
+
if __name__ == "__main__":
|
| 723 |
+
parser = argparse.ArgumentParser()
|
| 724 |
+
parser.add_argument("checkpoint_dir",
|
| 725 |
+
type=str,
|
| 726 |
+
help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
|
| 727 |
+
parser.add_argument("output_dir",
|
| 728 |
+
type=str,
|
| 729 |
+
help="directory to the pytorch fp32 state_dict output files"
|
| 730 |
+
"(e.g. path/checkpoint-12-output/)")
|
| 731 |
+
parser.add_argument(
|
| 732 |
+
"--max_shard_size",
|
| 733 |
+
type=str,
|
| 734 |
+
default="5GB",
|
| 735 |
+
help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
|
| 736 |
+
"lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
|
| 737 |
+
"We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
|
| 738 |
+
"without CPU OOM issues.")
|
| 739 |
+
parser.add_argument(
|
| 740 |
+
"--safe_serialization",
|
| 741 |
+
default=False,
|
| 742 |
+
action='store_true',
|
| 743 |
+
help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
|
| 744 |
+
parser.add_argument("-t",
|
| 745 |
+
"--tag",
|
| 746 |
+
type=str,
|
| 747 |
+
default=None,
|
| 748 |
+
help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
|
| 749 |
+
parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
|
| 750 |
+
parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
|
| 751 |
+
args = parser.parse_args()
|
| 752 |
+
|
| 753 |
+
debug = args.debug
|
| 754 |
+
|
| 755 |
+
convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
|
| 756 |
+
args.output_dir,
|
| 757 |
+
max_shard_size=args.max_shard_size,
|
| 758 |
+
safe_serialization=args.safe_serialization,
|
| 759 |
+
tag=args.tag,
|
| 760 |
+
exclude_frozen_parameters=args.exclude_frozen_parameters)
|
train/run.log
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:113604a0593995bd195e228d29e0ad07f873a1f75f0b34a442fab6859b9e1a81
|
| 3 |
+
size 28734203
|
train/run_debug.log
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[2025-09-09 08:30:47,080][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 2 |
+
[2025-09-09 08:30:47,081][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 3 |
+
[2025-09-09 08:30:47,090][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 4 |
+
[2025-09-09 08:30:47,114][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 5 |
+
[2025-09-09 08:30:47,114][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 6 |
+
[2025-09-09 08:30:47,125][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 7 |
+
[2025-09-09 08:30:47,133][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 8 |
+
[2025-09-09 08:30:47,134][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 9 |
+
[2025-09-09 08:30:47,140][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 10 |
+
[2025-09-09 08:30:47,140][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 11 |
+
[2025-09-09 08:30:47,142][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 12 |
+
[2025-09-09 08:30:47,151][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 13 |
+
[2025-09-09 08:31:18,989][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 14 |
+
[2025-09-09 08:31:18,991][__main__][INFO] - Dataset created.
|
| 15 |
+
[2025-09-09 08:31:19,062][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 16 |
+
[2025-09-09 08:31:19,063][__main__][INFO] - Dataset created.
|
| 17 |
+
[2025-09-09 08:31:19,150][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 18 |
+
[2025-09-09 08:31:19,152][__main__][INFO] - Dataset created.
|
| 19 |
+
[2025-09-09 08:31:19,365][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 20 |
+
[2025-09-09 08:31:19,367][__main__][INFO] - Dataset created.
|
| 21 |
+
[2025-09-09 08:35:29,723][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 22 |
+
[2025-09-09 08:35:29,724][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 23 |
+
[2025-09-09 08:35:29,728][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 24 |
+
[2025-09-09 08:35:29,729][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 25 |
+
[2025-09-09 08:35:29,732][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 26 |
+
[2025-09-09 08:35:29,733][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 27 |
+
[2025-09-09 08:35:29,734][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 28 |
+
[2025-09-09 08:35:29,736][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 29 |
+
[2025-09-09 08:35:29,740][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 30 |
+
[2025-09-09 08:35:29,867][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 31 |
+
[2025-09-09 08:35:29,867][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 32 |
+
[2025-09-09 08:35:29,877][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 33 |
+
[2025-09-09 08:35:55,221][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 34 |
+
[2025-09-09 08:35:55,223][__main__][INFO] - Dataset created.
|
| 35 |
+
[2025-09-09 08:35:55,286][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 36 |
+
[2025-09-09 08:35:55,287][__main__][INFO] - Dataset created.
|
| 37 |
+
[2025-09-09 08:35:55,309][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 38 |
+
[2025-09-09 08:35:55,311][__main__][INFO] - Dataset created.
|
| 39 |
+
[2025-09-09 08:35:55,357][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 40 |
+
[2025-09-09 08:35:55,358][__main__][INFO] - Dataset created.
|
| 41 |
+
[2025-09-09 08:46:56,903][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 42 |
+
[2025-09-09 08:46:56,903][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 43 |
+
[2025-09-09 08:46:56,913][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 44 |
+
[2025-09-09 08:46:56,914][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 45 |
+
[2025-09-09 08:46:56,914][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 46 |
+
[2025-09-09 08:46:56,917][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 47 |
+
[2025-09-09 08:46:56,917][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 48 |
+
[2025-09-09 08:46:56,918][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 49 |
+
[2025-09-09 08:46:56,919][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 50 |
+
[2025-09-09 08:46:56,922][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 51 |
+
[2025-09-09 08:46:56,926][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 52 |
+
[2025-09-09 08:46:56,926][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 53 |
+
[2025-09-09 08:47:23,717][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 54 |
+
[2025-09-09 08:47:23,718][__main__][INFO] - Dataset created.
|
| 55 |
+
[2025-09-09 08:47:23,902][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 56 |
+
[2025-09-09 08:47:23,903][__main__][INFO] - Dataset created.
|
| 57 |
+
[2025-09-09 08:47:24,121][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 58 |
+
[2025-09-09 08:47:24,122][__main__][INFO] - Dataset created.
|
| 59 |
+
[2025-09-09 08:47:24,274][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 60 |
+
[2025-09-09 08:47:24,275][__main__][INFO] - Dataset created.
|
| 61 |
+
[2025-09-09 08:48:41,229][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 62 |
+
[2025-09-09 08:48:41,229][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 63 |
+
[2025-09-09 08:48:41,229][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 64 |
+
[2025-09-09 08:48:41,230][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 65 |
+
[2025-09-09 08:48:41,233][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 66 |
+
[2025-09-09 08:48:41,233][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 67 |
+
[2025-09-09 08:48:41,238][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 68 |
+
[2025-09-09 08:48:41,238][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 69 |
+
[2025-09-09 08:48:41,240][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 70 |
+
[2025-09-09 08:48:41,377][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 71 |
+
[2025-09-09 08:48:41,378][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 72 |
+
[2025-09-09 08:48:41,385][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 73 |
+
[2025-09-09 08:49:06,846][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 74 |
+
[2025-09-09 08:49:06,847][__main__][INFO] - Dataset created.
|
| 75 |
+
[2025-09-09 08:49:07,181][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 76 |
+
[2025-09-09 08:49:07,182][__main__][INFO] - Dataset created.
|
| 77 |
+
[2025-09-09 08:49:07,219][models.internvl.configuration_internvl_chat][INFO] - vision_select_layer: -1
|
| 78 |
+
[2025-09-09 08:49:07,220][models.internvl.configuration_internvl_chat][INFO] - ps_version: v2
|
| 79 |
+
[2025-09-09 08:49:07,220][models.internvl.configuration_internvl_chat][INFO] - min_dynamic_patch: 1
|
| 80 |
+
[2025-09-09 08:49:07,220][models.internvl.configuration_internvl_chat][INFO] - max_dynamic_patch: 12
|
| 81 |
+
[2025-09-09 08:49:07,220][__main__][INFO] - Loading model from output/train/ckpt_23000/output_dir
|
| 82 |
+
[2025-09-09 08:49:07,239][models.st_model][INFO] - num_image_token: 256
|
| 83 |
+
[2025-09-09 08:49:07,239][models.st_model][INFO] - ps_version: v2
|
| 84 |
+
[2025-09-09 08:49:07,524][models.internvl.configuration_internvl_chat][INFO] - vision_select_layer: -1
|
| 85 |
+
[2025-09-09 08:49:07,524][models.internvl.configuration_internvl_chat][INFO] - ps_version: v2
|
| 86 |
+
[2025-09-09 08:49:07,525][models.internvl.configuration_internvl_chat][INFO] - min_dynamic_patch: 1
|
| 87 |
+
[2025-09-09 08:49:07,525][models.internvl.configuration_internvl_chat][INFO] - max_dynamic_patch: 12
|
| 88 |
+
[2025-09-09 08:49:07,525][__main__][INFO] - Loading model from output/train/ckpt_23000/output_dir
|
| 89 |
+
[2025-09-09 08:49:07,534][models.st_model][INFO] - num_image_token: 256
|
| 90 |
+
[2025-09-09 08:49:07,534][models.st_model][INFO] - ps_version: v2
|
| 91 |
+
[2025-09-09 08:49:08,044][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 92 |
+
[2025-09-09 08:49:08,046][__main__][INFO] - Dataset created.
|
| 93 |
+
[2025-09-09 08:49:08,408][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 94 |
+
[2025-09-09 08:49:08,409][__main__][INFO] - Dataset created.
|
| 95 |
+
[2025-09-09 08:49:08,461][models.internvl.configuration_internvl_chat][INFO] - vision_select_layer: -1
|
| 96 |
+
[2025-09-09 08:49:08,462][models.internvl.configuration_internvl_chat][INFO] - ps_version: v2
|
| 97 |
+
[2025-09-09 08:49:08,462][models.internvl.configuration_internvl_chat][INFO] - min_dynamic_patch: 1
|
| 98 |
+
[2025-09-09 08:49:08,462][models.internvl.configuration_internvl_chat][INFO] - max_dynamic_patch: 12
|
| 99 |
+
[2025-09-09 08:49:08,463][__main__][INFO] - Loading model from output/train/ckpt_23000/output_dir
|
| 100 |
+
[2025-09-09 08:49:08,474][models.st_model][INFO] - num_image_token: 256
|
| 101 |
+
[2025-09-09 08:49:08,474][models.st_model][INFO] - ps_version: v2
|
| 102 |
+
[2025-09-09 08:49:08,777][__main__][INFO] - Added 122 tokens to the tokenizer.
|
| 103 |
+
[2025-09-09 08:49:08,795][__main__][INFO] - Token name to index dictionary: {'<pattern_cmd_MOVE>': 151674, '<pattern_cmd_LINE>': 151675, '<pattern_cmd_CLINE>': 151676, '<pattern_cmd_CURVE>': 151677, '<pattern_cmd_CCURVE>': 151678, '<pattern_cmd_CUBIC>': 151679, '<pattern_cmd_CCUBIC>': 151680, '<pattern_cmd_ARC>': 151681, '<pattern_cmd_CARC>': 151682, '<panel_start>': 151683, '<panel_end>': 151684, '<pattern_start>': 151685, '<pattern_end>': 151686, '<stitch_tag_0>': 151687, '<stitch_tag_1>': 151688, '<stitch_tag_2>': 151689, '<stitch_tag_3>': 151690, '<stitch_tag_4>': 151691, '<stitch_tag_5>': 151692, '<stitch_tag_6>': 151693, '<stitch_tag_7>': 151694, '<stitch_tag_8>': 151695, '<stitch_tag_9>': 151696, '<stitch_tag_10>': 151697, '<stitch_tag_11>': 151698, '<stitch_tag_12>': 151699, '<stitch_tag_13>': 151700, '<stitch_tag_14>': 151701, '<stitch_tag_15>': 151702, '<stitch_tag_16>': 151703, '<stitch_tag_17>': 151704, '<stitch_tag_18>': 151705, '<stitch_tag_19>': 151706, '<stitch_tag_20>': 151707, '<stitch_tag_21>': 151708, '<stitch_tag_22>': 151709, '<stitch_tag_23>': 151710, '<stitch_tag_24>': 151711, '<stitch_tag_25>': 151712, '<stitch_tag_26>': 151713, '<stitch_tag_27>': 151714, '<stitch_tag_28>': 151715, '<stitch_tag_29>': 151716, '<stitch_tag_30>': 151717, '<stitch_tag_31>': 151718, '<stitch_tag_32>': 151719, '<stitch_tag_33>': 151720, '<stitch_tag_34>': 151721, '<stitch_tag_35>': 151722, '<stitch_tag_36>': 151723, '<stitch_tag_37>': 151724, '<stitch_tag_38>': 151725, '<stitch_tag_39>': 151726, '<stitch_tag_40>': 151727, '<stitch_tag_41>': 151728, '<stitch_tag_42>': 151729, '<stitch_tag_43>': 151730, '<stitch_tag_44>': 151731, '<stitch_tag_45>': 151732, '<stitch_tag_46>': 151733, '<stitch_tag_47>': 151734, '<stitch_tag_48>': 151735, '<stitch_tag_49>': 151736, '<stitch_tag_50>': 151737, '<stitch_tag_51>': 151738, '<stitch_tag_52>': 151739, '<stitch_tag_53>': 151740, '<stitch_tag_54>': 151741, '<stitch_tag_55>': 151742, '<stitch_tag_56>': 151743, '<stitch_tag_57>': 151744, '<stitch_tag_58>': 151745, '<stitch_tag_59>': 151746, '<stitch_tag_60>': 151747, '<stitch_tag_61>': 151748, '<stitch_tag_62>': 151749, '<stitch_tag_63>': 151750, '<stitch_tag_64>': 151751, '<stitch_tag_65>': 151752, '<stitch_tag_66>': 151753, '<stitch_tag_67>': 151754, '<stitch_tag_68>': 151755, '<stitch_tag_69>': 151756, '<stitch_tag_70>': 151757, '<stitch_tag_71>': 151758, '<stitch_tag_72>': 151759, '<stitch_tag_73>': 151760, '<stitch_tag_74>': 151761, '<stitch_tag_75>': 151762, '<stitch_tag_76>': 151763, '<stitch_tag_77>': 151764, '<stitch_tag_78>': 151765, '<stitch_tag_79>': 151766, '<stitch_tag_80>': 151767, '<stitch_tag_81>': 151768, '<stitch_tag_82>': 151769, '<stitch_tag_83>': 151770, '<stitch_tag_84>': 151771, '<stitch_tag_85>': 151772, '<stitch_tag_86>': 151773, '<stitch_tag_87>': 151774, '<stitch_tag_88>': 151775, '<stitch_tag_89>': 151776, '<stitch_tag_90>': 151777, '<stitch_tag_91>': 151778, '<stitch_tag_92>': 151779, '<stitch_tag_93>': 151780, '<stitch_tag_94>': 151781, '<stitch_tag_95>': 151782, '<stitch_tag_96>': 151783, '<stitch_tag_97>': 151784, '<stitch_tag_98>': 151785, '<stitch_tag_99>': 151786, '<stitch_tag_100>': 151787, '<stitch_tag_101>': 151788, '<stitch_tag_102>': 151789, '<stitch_tag_103>': 151790, '<stitch_tag_104>': 151791, '<stitch_tag_105>': 151792, '<stitch_tag_106>': 151793, '<stitch_tag_107>': 151794, '<stitch_tag_null>': 151795}
|
| 104 |
+
[2025-09-09 08:49:08,801][models.internvl.configuration_internvl_chat][INFO] - vision_select_layer: -1
|
| 105 |
+
[2025-09-09 08:49:08,803][models.internvl.configuration_internvl_chat][INFO] - ps_version: v2
|
| 106 |
+
[2025-09-09 08:49:08,805][models.internvl.configuration_internvl_chat][INFO] - min_dynamic_patch: 1
|
| 107 |
+
[2025-09-09 08:49:08,805][models.internvl.configuration_internvl_chat][INFO] - max_dynamic_patch: 12
|
| 108 |
+
[2025-09-09 08:49:08,806][__main__][INFO] - Loading model from output/train/ckpt_23000/output_dir
|
| 109 |
+
[2025-09-09 08:49:08,821][models.st_model][INFO] - num_image_token: 256
|
| 110 |
+
[2025-09-09 08:49:08,822][models.st_model][INFO] - ps_version: v2
|
| 111 |
+
[2025-09-09 08:50:56,142][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 112 |
+
[2025-09-09 08:50:56,142][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 113 |
+
[2025-09-09 08:50:56,151][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 114 |
+
[2025-09-09 08:51:20,931][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 115 |
+
[2025-09-09 08:51:20,934][__main__][INFO] - Dataset created.
|
| 116 |
+
[2025-09-09 08:51:21,219][__main__][INFO] - Added 122 tokens to the tokenizer.
|
| 117 |
+
[2025-09-09 08:51:21,234][__main__][INFO] - Token name to index dictionary: {'<pattern_cmd_MOVE>': 151674, '<pattern_cmd_LINE>': 151675, '<pattern_cmd_CLINE>': 151676, '<pattern_cmd_CURVE>': 151677, '<pattern_cmd_CCURVE>': 151678, '<pattern_cmd_CUBIC>': 151679, '<pattern_cmd_CCUBIC>': 151680, '<pattern_cmd_ARC>': 151681, '<pattern_cmd_CARC>': 151682, '<panel_start>': 151683, '<panel_end>': 151684, '<pattern_start>': 151685, '<pattern_end>': 151686, '<stitch_tag_0>': 151687, '<stitch_tag_1>': 151688, '<stitch_tag_2>': 151689, '<stitch_tag_3>': 151690, '<stitch_tag_4>': 151691, '<stitch_tag_5>': 151692, '<stitch_tag_6>': 151693, '<stitch_tag_7>': 151694, '<stitch_tag_8>': 151695, '<stitch_tag_9>': 151696, '<stitch_tag_10>': 151697, '<stitch_tag_11>': 151698, '<stitch_tag_12>': 151699, '<stitch_tag_13>': 151700, '<stitch_tag_14>': 151701, '<stitch_tag_15>': 151702, '<stitch_tag_16>': 151703, '<stitch_tag_17>': 151704, '<stitch_tag_18>': 151705, '<stitch_tag_19>': 151706, '<stitch_tag_20>': 151707, '<stitch_tag_21>': 151708, '<stitch_tag_22>': 151709, '<stitch_tag_23>': 151710, '<stitch_tag_24>': 151711, '<stitch_tag_25>': 151712, '<stitch_tag_26>': 151713, '<stitch_tag_27>': 151714, '<stitch_tag_28>': 151715, '<stitch_tag_29>': 151716, '<stitch_tag_30>': 151717, '<stitch_tag_31>': 151718, '<stitch_tag_32>': 151719, '<stitch_tag_33>': 151720, '<stitch_tag_34>': 151721, '<stitch_tag_35>': 151722, '<stitch_tag_36>': 151723, '<stitch_tag_37>': 151724, '<stitch_tag_38>': 151725, '<stitch_tag_39>': 151726, '<stitch_tag_40>': 151727, '<stitch_tag_41>': 151728, '<stitch_tag_42>': 151729, '<stitch_tag_43>': 151730, '<stitch_tag_44>': 151731, '<stitch_tag_45>': 151732, '<stitch_tag_46>': 151733, '<stitch_tag_47>': 151734, '<stitch_tag_48>': 151735, '<stitch_tag_49>': 151736, '<stitch_tag_50>': 151737, '<stitch_tag_51>': 151738, '<stitch_tag_52>': 151739, '<stitch_tag_53>': 151740, '<stitch_tag_54>': 151741, '<stitch_tag_55>': 151742, '<stitch_tag_56>': 151743, '<stitch_tag_57>': 151744, '<stitch_tag_58>': 151745, '<stitch_tag_59>': 151746, '<stitch_tag_60>': 151747, '<stitch_tag_61>': 151748, '<stitch_tag_62>': 151749, '<stitch_tag_63>': 151750, '<stitch_tag_64>': 151751, '<stitch_tag_65>': 151752, '<stitch_tag_66>': 151753, '<stitch_tag_67>': 151754, '<stitch_tag_68>': 151755, '<stitch_tag_69>': 151756, '<stitch_tag_70>': 151757, '<stitch_tag_71>': 151758, '<stitch_tag_72>': 151759, '<stitch_tag_73>': 151760, '<stitch_tag_74>': 151761, '<stitch_tag_75>': 151762, '<stitch_tag_76>': 151763, '<stitch_tag_77>': 151764, '<stitch_tag_78>': 151765, '<stitch_tag_79>': 151766, '<stitch_tag_80>': 151767, '<stitch_tag_81>': 151768, '<stitch_tag_82>': 151769, '<stitch_tag_83>': 151770, '<stitch_tag_84>': 151771, '<stitch_tag_85>': 151772, '<stitch_tag_86>': 151773, '<stitch_tag_87>': 151774, '<stitch_tag_88>': 151775, '<stitch_tag_89>': 151776, '<stitch_tag_90>': 151777, '<stitch_tag_91>': 151778, '<stitch_tag_92>': 151779, '<stitch_tag_93>': 151780, '<stitch_tag_94>': 151781, '<stitch_tag_95>': 151782, '<stitch_tag_96>': 151783, '<stitch_tag_97>': 151784, '<stitch_tag_98>': 151785, '<stitch_tag_99>': 151786, '<stitch_tag_100>': 151787, '<stitch_tag_101>': 151788, '<stitch_tag_102>': 151789, '<stitch_tag_103>': 151790, '<stitch_tag_104>': 151791, '<stitch_tag_105>': 151792, '<stitch_tag_106>': 151793, '<stitch_tag_107>': 151794, '<stitch_tag_null>': 151795}
|
| 118 |
+
[2025-09-09 08:51:21,237][models.internvl.configuration_internvl_chat][INFO] - vision_select_layer: -1
|
| 119 |
+
[2025-09-09 08:51:21,237][models.internvl.configuration_internvl_chat][INFO] - ps_version: v2
|
| 120 |
+
[2025-09-09 08:51:21,237][models.internvl.configuration_internvl_chat][INFO] - min_dynamic_patch: 1
|
| 121 |
+
[2025-09-09 08:51:21,237][models.internvl.configuration_internvl_chat][INFO] - max_dynamic_patch: 12
|
| 122 |
+
[2025-09-09 08:51:21,237][__main__][INFO] - Loading model from output/train/ckpt_23000/output_dir
|
| 123 |
+
[2025-09-09 08:51:21,246][models.st_model][INFO] - num_image_token: 256
|
| 124 |
+
[2025-09-09 08:51:21,246][models.st_model][INFO] - ps_version: v2
|
| 125 |
+
[2025-09-09 08:52:10,452][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 126 |
+
[2025-09-09 08:52:10,453][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 127 |
+
[2025-09-09 08:52:10,462][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 128 |
+
[2025-09-09 08:52:43,215][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 129 |
+
[2025-09-09 08:52:43,216][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 130 |
+
[2025-09-09 08:52:43,224][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 131 |
+
[2025-09-09 08:53:08,039][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 132 |
+
[2025-09-09 08:53:08,040][__main__][INFO] - Dataset created.
|
| 133 |
+
[2025-09-09 08:53:08,325][__main__][INFO] - Added 122 tokens to the tokenizer.
|
| 134 |
+
[2025-09-09 08:53:08,342][__main__][INFO] - Token name to index dictionary: {'<pattern_cmd_MOVE>': 151674, '<pattern_cmd_LINE>': 151675, '<pattern_cmd_CLINE>': 151676, '<pattern_cmd_CURVE>': 151677, '<pattern_cmd_CCURVE>': 151678, '<pattern_cmd_CUBIC>': 151679, '<pattern_cmd_CCUBIC>': 151680, '<pattern_cmd_ARC>': 151681, '<pattern_cmd_CARC>': 151682, '<panel_start>': 151683, '<panel_end>': 151684, '<pattern_start>': 151685, '<pattern_end>': 151686, '<stitch_tag_0>': 151687, '<stitch_tag_1>': 151688, '<stitch_tag_2>': 151689, '<stitch_tag_3>': 151690, '<stitch_tag_4>': 151691, '<stitch_tag_5>': 151692, '<stitch_tag_6>': 151693, '<stitch_tag_7>': 151694, '<stitch_tag_8>': 151695, '<stitch_tag_9>': 151696, '<stitch_tag_10>': 151697, '<stitch_tag_11>': 151698, '<stitch_tag_12>': 151699, '<stitch_tag_13>': 151700, '<stitch_tag_14>': 151701, '<stitch_tag_15>': 151702, '<stitch_tag_16>': 151703, '<stitch_tag_17>': 151704, '<stitch_tag_18>': 151705, '<stitch_tag_19>': 151706, '<stitch_tag_20>': 151707, '<stitch_tag_21>': 151708, '<stitch_tag_22>': 151709, '<stitch_tag_23>': 151710, '<stitch_tag_24>': 151711, '<stitch_tag_25>': 151712, '<stitch_tag_26>': 151713, '<stitch_tag_27>': 151714, '<stitch_tag_28>': 151715, '<stitch_tag_29>': 151716, '<stitch_tag_30>': 151717, '<stitch_tag_31>': 151718, '<stitch_tag_32>': 151719, '<stitch_tag_33>': 151720, '<stitch_tag_34>': 151721, '<stitch_tag_35>': 151722, '<stitch_tag_36>': 151723, '<stitch_tag_37>': 151724, '<stitch_tag_38>': 151725, '<stitch_tag_39>': 151726, '<stitch_tag_40>': 151727, '<stitch_tag_41>': 151728, '<stitch_tag_42>': 151729, '<stitch_tag_43>': 151730, '<stitch_tag_44>': 151731, '<stitch_tag_45>': 151732, '<stitch_tag_46>': 151733, '<stitch_tag_47>': 151734, '<stitch_tag_48>': 151735, '<stitch_tag_49>': 151736, '<stitch_tag_50>': 151737, '<stitch_tag_51>': 151738, '<stitch_tag_52>': 151739, '<stitch_tag_53>': 151740, '<stitch_tag_54>': 151741, '<stitch_tag_55>': 151742, '<stitch_tag_56>': 151743, '<stitch_tag_57>': 151744, '<stitch_tag_58>': 151745, '<stitch_tag_59>': 151746, '<stitch_tag_60>': 151747, '<stitch_tag_61>': 151748, '<stitch_tag_62>': 151749, '<stitch_tag_63>': 151750, '<stitch_tag_64>': 151751, '<stitch_tag_65>': 151752, '<stitch_tag_66>': 151753, '<stitch_tag_67>': 151754, '<stitch_tag_68>': 151755, '<stitch_tag_69>': 151756, '<stitch_tag_70>': 151757, '<stitch_tag_71>': 151758, '<stitch_tag_72>': 151759, '<stitch_tag_73>': 151760, '<stitch_tag_74>': 151761, '<stitch_tag_75>': 151762, '<stitch_tag_76>': 151763, '<stitch_tag_77>': 151764, '<stitch_tag_78>': 151765, '<stitch_tag_79>': 151766, '<stitch_tag_80>': 151767, '<stitch_tag_81>': 151768, '<stitch_tag_82>': 151769, '<stitch_tag_83>': 151770, '<stitch_tag_84>': 151771, '<stitch_tag_85>': 151772, '<stitch_tag_86>': 151773, '<stitch_tag_87>': 151774, '<stitch_tag_88>': 151775, '<stitch_tag_89>': 151776, '<stitch_tag_90>': 151777, '<stitch_tag_91>': 151778, '<stitch_tag_92>': 151779, '<stitch_tag_93>': 151780, '<stitch_tag_94>': 151781, '<stitch_tag_95>': 151782, '<stitch_tag_96>': 151783, '<stitch_tag_97>': 151784, '<stitch_tag_98>': 151785, '<stitch_tag_99>': 151786, '<stitch_tag_100>': 151787, '<stitch_tag_101>': 151788, '<stitch_tag_102>': 151789, '<stitch_tag_103>': 151790, '<stitch_tag_104>': 151791, '<stitch_tag_105>': 151792, '<stitch_tag_106>': 151793, '<stitch_tag_107>': 151794, '<stitch_tag_null>': 151795}
|
| 135 |
+
[2025-09-09 08:53:08,345][models.internvl.configuration_internvl_chat][INFO] - vision_select_layer: -1
|
| 136 |
+
[2025-09-09 08:53:08,345][models.internvl.configuration_internvl_chat][INFO] - ps_version: v2
|
| 137 |
+
[2025-09-09 08:53:08,345][models.internvl.configuration_internvl_chat][INFO] - min_dynamic_patch: 1
|
| 138 |
+
[2025-09-09 08:53:08,345][models.internvl.configuration_internvl_chat][INFO] - max_dynamic_patch: 12
|
| 139 |
+
[2025-09-09 08:53:08,346][__main__][INFO] - Loading model from output/train/ckpt_23000/output_dir
|
| 140 |
+
[2025-09-09 08:53:08,356][models.st_model][INFO] - num_image_token: 256
|
| 141 |
+
[2025-09-09 08:53:08,356][models.st_model][INFO] - ps_version: v2
|
| 142 |
+
[2025-09-09 09:02:06,438][__main__][INFO] - Working directory : /root/workspace/SwiftTailor3
|
| 143 |
+
[2025-09-09 09:02:06,438][__main__][INFO] - Output directory : /root/workspace/SwiftTailor3/output/train
|
| 144 |
+
[2025-09-09 09:02:06,447][data.data_wrappers.data_wrapper][INFO] - Loading data split from assets/data_configs/garmentcodedata_datasplit.json
|
| 145 |
+
[2025-09-09 09:02:31,548][data.data_wrappers.data_wrapper][INFO] - Dataset split: 114869 / 6381 / 6381
|
| 146 |
+
[2025-09-09 09:02:31,549][__main__][INFO] - Dataset created.
|
| 147 |
+
[2025-09-09 09:02:31,905][__main__][INFO] - Added 122 tokens to the tokenizer.
|
| 148 |
+
[2025-09-09 09:02:31,922][__main__][INFO] - Token name to index dictionary: {'<pattern_cmd_MOVE>': 151674, '<pattern_cmd_LINE>': 151675, '<pattern_cmd_CLINE>': 151676, '<pattern_cmd_CURVE>': 151677, '<pattern_cmd_CCURVE>': 151678, '<pattern_cmd_CUBIC>': 151679, '<pattern_cmd_CCUBIC>': 151680, '<pattern_cmd_ARC>': 151681, '<pattern_cmd_CARC>': 151682, '<panel_start>': 151683, '<panel_end>': 151684, '<pattern_start>': 151685, '<pattern_end>': 151686, '<stitch_tag_0>': 151687, '<stitch_tag_1>': 151688, '<stitch_tag_2>': 151689, '<stitch_tag_3>': 151690, '<stitch_tag_4>': 151691, '<stitch_tag_5>': 151692, '<stitch_tag_6>': 151693, '<stitch_tag_7>': 151694, '<stitch_tag_8>': 151695, '<stitch_tag_9>': 151696, '<stitch_tag_10>': 151697, '<stitch_tag_11>': 151698, '<stitch_tag_12>': 151699, '<stitch_tag_13>': 151700, '<stitch_tag_14>': 151701, '<stitch_tag_15>': 151702, '<stitch_tag_16>': 151703, '<stitch_tag_17>': 151704, '<stitch_tag_18>': 151705, '<stitch_tag_19>': 151706, '<stitch_tag_20>': 151707, '<stitch_tag_21>': 151708, '<stitch_tag_22>': 151709, '<stitch_tag_23>': 151710, '<stitch_tag_24>': 151711, '<stitch_tag_25>': 151712, '<stitch_tag_26>': 151713, '<stitch_tag_27>': 151714, '<stitch_tag_28>': 151715, '<stitch_tag_29>': 151716, '<stitch_tag_30>': 151717, '<stitch_tag_31>': 151718, '<stitch_tag_32>': 151719, '<stitch_tag_33>': 151720, '<stitch_tag_34>': 151721, '<stitch_tag_35>': 151722, '<stitch_tag_36>': 151723, '<stitch_tag_37>': 151724, '<stitch_tag_38>': 151725, '<stitch_tag_39>': 151726, '<stitch_tag_40>': 151727, '<stitch_tag_41>': 151728, '<stitch_tag_42>': 151729, '<stitch_tag_43>': 151730, '<stitch_tag_44>': 151731, '<stitch_tag_45>': 151732, '<stitch_tag_46>': 151733, '<stitch_tag_47>': 151734, '<stitch_tag_48>': 151735, '<stitch_tag_49>': 151736, '<stitch_tag_50>': 151737, '<stitch_tag_51>': 151738, '<stitch_tag_52>': 151739, '<stitch_tag_53>': 151740, '<stitch_tag_54>': 151741, '<stitch_tag_55>': 151742, '<stitch_tag_56>': 151743, '<stitch_tag_57>': 151744, '<stitch_tag_58>': 151745, '<stitch_tag_59>': 151746, '<stitch_tag_60>': 151747, '<stitch_tag_61>': 151748, '<stitch_tag_62>': 151749, '<stitch_tag_63>': 151750, '<stitch_tag_64>': 151751, '<stitch_tag_65>': 151752, '<stitch_tag_66>': 151753, '<stitch_tag_67>': 151754, '<stitch_tag_68>': 151755, '<stitch_tag_69>': 151756, '<stitch_tag_70>': 151757, '<stitch_tag_71>': 151758, '<stitch_tag_72>': 151759, '<stitch_tag_73>': 151760, '<stitch_tag_74>': 151761, '<stitch_tag_75>': 151762, '<stitch_tag_76>': 151763, '<stitch_tag_77>': 151764, '<stitch_tag_78>': 151765, '<stitch_tag_79>': 151766, '<stitch_tag_80>': 151767, '<stitch_tag_81>': 151768, '<stitch_tag_82>': 151769, '<stitch_tag_83>': 151770, '<stitch_tag_84>': 151771, '<stitch_tag_85>': 151772, '<stitch_tag_86>': 151773, '<stitch_tag_87>': 151774, '<stitch_tag_88>': 151775, '<stitch_tag_89>': 151776, '<stitch_tag_90>': 151777, '<stitch_tag_91>': 151778, '<stitch_tag_92>': 151779, '<stitch_tag_93>': 151780, '<stitch_tag_94>': 151781, '<stitch_tag_95>': 151782, '<stitch_tag_96>': 151783, '<stitch_tag_97>': 151784, '<stitch_tag_98>': 151785, '<stitch_tag_99>': 151786, '<stitch_tag_100>': 151787, '<stitch_tag_101>': 151788, '<stitch_tag_102>': 151789, '<stitch_tag_103>': 151790, '<stitch_tag_104>': 151791, '<stitch_tag_105>': 151792, '<stitch_tag_106>': 151793, '<stitch_tag_107>': 151794, '<stitch_tag_null>': 151795}
|
| 149 |
+
[2025-09-09 09:02:31,925][models.internvl.configuration_internvl_chat][INFO] - vision_select_layer: -1
|
| 150 |
+
[2025-09-09 09:02:31,925][models.internvl.configuration_internvl_chat][INFO] - ps_version: v2
|
| 151 |
+
[2025-09-09 09:02:31,925][models.internvl.configuration_internvl_chat][INFO] - min_dynamic_patch: 1
|
| 152 |
+
[2025-09-09 09:02:31,925][models.internvl.configuration_internvl_chat][INFO] - max_dynamic_patch: 12
|
| 153 |
+
[2025-09-09 09:02:31,925][__main__][INFO] - Loading model from output/train/ckpt_23000/output_dir
|
| 154 |
+
[2025-09-09 09:02:31,935][models.st_model][INFO] - num_image_token: 256
|
| 155 |
+
[2025-09-09 09:02:31,935][models.st_model][INFO] - ps_version: v2
|
train/run_inference.log
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b5379585e7196a6b9587ca01e0722ad0651f2f7be6d7d0613c2d6c74b02d7e0f
|
| 3 |
+
size 180716918
|