WinstonHu commited on
Commit
7b0f62d
·
verified ·
1 Parent(s): ff8b55e

Upload folder 20250924_184838 to stage_1/token_merge_plus_resampler/20250924_184838

Browse files
stage_1/token_merge_plus_resampler/20250924_184838/20250924_184838.log ADDED
The diff for this file is too large to render. See raw diff
 
stage_1/token_merge_plus_resampler/20250924_184838/vis_data/20250924_184838.json ADDED
The diff for this file is too large to render. See raw diff
 
stage_1/token_merge_plus_resampler/20250924_184838/vis_data/config.py ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ SYSTEM = ''
2
+ accumulative_counts = 256
3
+ batch_size = 1
4
+ betas = (
5
+ 0.9,
6
+ 0.999,
7
+ )
8
+ bnb = dict(
9
+ bnb_4bit_compute_dtype='torch.bfloat16',
10
+ bnb_4bit_quant_type='nf4',
11
+ bnb_4bit_use_double_quant=True,
12
+ llm_int8_has_fp16_weight=False,
13
+ llm_int8_threshold=6.0,
14
+ load_in_4bit=True,
15
+ load_in_8bit=False,
16
+ type='transformers.BitsAndBytesConfig')
17
+ custom_hooks = [
18
+ dict(
19
+ tokenizer=dict(
20
+ padding_side='right',
21
+ pretrained_model_name_or_path='Qwen/Qwen2.5-7B-Instruct',
22
+ trust_remote_code=True,
23
+ type='transformers.AutoTokenizer.from_pretrained'),
24
+ type='xtuner.engine.hooks.DatasetInfoHook'),
25
+ dict(
26
+ evaluation_images=
27
+ '/mnt/bn/xudong-va/meilong/datasets/Token_Compression/skcm_224x224_b20_t15/h5_files/TCGA-EB-A5UN-06Z-00-DX1.h5',
28
+ evaluation_inputs=[
29
+ 'Are the tumor cells organized in a lobulated pattern within the slide?',
30
+ ],
31
+ every_n_iters=512,
32
+ prompt_template='xtuner.utils.PROMPT_TEMPLATE.qwen_chat',
33
+ system='',
34
+ tokenizer=dict(
35
+ padding_side='right',
36
+ pretrained_model_name_or_path='Qwen/Qwen2.5-7B-Instruct',
37
+ trust_remote_code=True,
38
+ type='transformers.AutoTokenizer.from_pretrained'),
39
+ type='xtuner.engine.hooks.EvaluateChatHookResampler'),
40
+ dict(type='xtuner.engine.hooks.ThroughputHook'),
41
+ ]
42
+ data_path = '/mnt/bn/yuxuanwang/meilong/code/projects/efficient_foundation_wsi_llava/merged_dataset/stage1_morph2.json'
43
+ dataloader_num_workers = 10
44
+ default_hooks = dict(
45
+ checkpoint=dict(
46
+ by_epoch=False,
47
+ interval=5120,
48
+ max_keep_ckpts=8,
49
+ type='mmengine.hooks.CheckpointHook'),
50
+ logger=dict(
51
+ interval=10,
52
+ log_metric_by_epoch=False,
53
+ type='mmengine.hooks.LoggerHook'),
54
+ param_scheduler=dict(type='mmengine.hooks.ParamSchedulerHook'),
55
+ sampler_seed=dict(type='mmengine.hooks.DistSamplerSeedHook'),
56
+ timer=dict(type='mmengine.hooks.IterTimerHook'))
57
+ env_cfg = dict(
58
+ cudnn_benchmark=False,
59
+ dist_cfg=dict(backend='nccl'),
60
+ mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0))
61
+ evaluation_freq = 512
62
+ evaluation_images = '/mnt/bn/xudong-va/meilong/datasets/Token_Compression/skcm_224x224_b20_t15/h5_files/TCGA-EB-A5UN-06Z-00-DX1.h5'
63
+ evaluation_inputs = [
64
+ 'Are the tumor cells organized in a lobulated pattern within the slide?',
65
+ ]
66
+ image_path_list = None
67
+ launcher = 'pytorch'
68
+ llava_dataset = dict(
69
+ data_path=
70
+ '/mnt/bn/yuxuanwang/meilong/code/projects/efficient_foundation_wsi_llava/merged_dataset/stage1_morph2.json',
71
+ dataset_map_fn='xtuner.dataset.map_fns.llava_map_fn',
72
+ identifier='_224x224_b20_t15',
73
+ image_feature_prefix='/mnt/bn/xudong-va/meilong/datasets/Token_Compression',
74
+ image_feature_suffix='.h5',
75
+ image_folder='',
76
+ image_path_list=None,
77
+ max_length=15836,
78
+ pad_image_to_square=False,
79
+ per_image_length=10240,
80
+ sample_num=10240,
81
+ sample_strategy='linspace',
82
+ template_map_fn=dict(
83
+ template='xtuner.utils.PROMPT_TEMPLATE.qwen_chat',
84
+ type='xtuner.dataset.map_fns.template_map_fn_factory'),
85
+ tokenizer=dict(
86
+ padding_side='right',
87
+ pretrained_model_name_or_path='Qwen/Qwen2.5-7B-Instruct',
88
+ trust_remote_code=True,
89
+ type='transformers.AutoTokenizer.from_pretrained'),
90
+ type='xtuner.dataset.LLaVADataset',
91
+ unwanted_prefix_csv=
92
+ '/mnt/bn/yuxuanwang/meilong/code/projects/efficient_foundation_wsi_llava/merged_dataset/missing_slides3.csv'
93
+ )
94
+ llm_name_or_path = 'Qwen/Qwen2.5-7B-Instruct'
95
+ load_from = None
96
+ log_level = 'INFO'
97
+ log_processor = dict(
98
+ by_epoch=False,
99
+ mean_pattern='.*(loss|time|data_time|grad_norm|tflops).*',
100
+ window_size=1)
101
+ lr = 0.001
102
+ max_epochs = 2
103
+ max_length = 15836
104
+ max_norm = 1
105
+ model = dict(
106
+ enable_token_merge=True,
107
+ freeze_llm=True,
108
+ llm=dict(
109
+ attn_implementation='flash_attention_2',
110
+ pretrained_model_name_or_path='Qwen/Qwen2.5-7B-Instruct',
111
+ quantization_config=dict(
112
+ bnb_4bit_compute_dtype='torch.bfloat16',
113
+ bnb_4bit_quant_type='nf4',
114
+ bnb_4bit_use_double_quant=True,
115
+ llm_int8_has_fp16_weight=False,
116
+ llm_int8_threshold=6.0,
117
+ load_in_4bit=True,
118
+ load_in_8bit=False,
119
+ type='transformers.BitsAndBytesConfig'),
120
+ torch_dtype='torch.bfloat16',
121
+ trust_remote_code=True,
122
+ type='transformers.AutoModelForCausalLM.from_pretrained'),
123
+ max_position_embeddings=None,
124
+ resampler_num_latents=100,
125
+ train_stage='1',
126
+ type='xtuner.model.llava_no_longnet_simple_sampler.LLaVAModel',
127
+ use_resampler=True)
128
+ optim_type = 'torch.optim.AdamW'
129
+ optim_wrapper = dict(
130
+ optimizer=dict(
131
+ betas=(
132
+ 0.9,
133
+ 0.999,
134
+ ),
135
+ lr=0.001,
136
+ type='torch.optim.AdamW',
137
+ weight_decay=0.0),
138
+ paramwise_cfg=dict(
139
+ bias_decay_mult=0.0,
140
+ norm_decay_mult=0.0,
141
+ paramwise_cfg=dict(
142
+ custom_keys=dict({'^projector\.': dict(lr_mult=1.0)}))),
143
+ type='DeepSpeedOptimWrapper')
144
+ param_scheduler = [
145
+ dict(
146
+ begin=0,
147
+ by_epoch=True,
148
+ convert_to_iter_based=True,
149
+ end=0.16,
150
+ start_factor=0.01,
151
+ type='mmengine.optim.LinearLR'),
152
+ dict(
153
+ begin=0.16,
154
+ by_epoch=True,
155
+ convert_to_iter_based=True,
156
+ end=2,
157
+ eta_min=0.0,
158
+ type='mmengine.optim.CosineAnnealingLR'),
159
+ ]
160
+ per_image_length = 10240
161
+ prompt_template = 'xtuner.utils.PROMPT_TEMPLATE.qwen_chat'
162
+ randomness = dict(deterministic=False, seed=42)
163
+ resume = False
164
+ runner_type = 'FlexibleRunner'
165
+ sample_type = 'wsi'
166
+ save_steps = 5120
167
+ save_total_limit = 8
168
+ seed = 42
169
+ strategy = dict(
170
+ config=dict(
171
+ bf16=dict(enabled=True),
172
+ fp16=dict(enabled=False, initial_scale_power=16),
173
+ gradient_accumulation_steps='auto',
174
+ gradient_clipping='auto',
175
+ train_micro_batch_size_per_gpu='auto',
176
+ zero_allow_untested_optimizer=True,
177
+ zero_force_ds_cpu_optimizer=False,
178
+ zero_optimization=dict(overlap_comm=False, stage=2)),
179
+ exclude_frozen_parameters=True,
180
+ gradient_accumulation_steps=256,
181
+ gradient_clipping=1,
182
+ sequence_parallel_size=1,
183
+ train_micro_batch_size_per_gpu=1,
184
+ type='xtuner.engine.DeepSpeedStrategy')
185
+ tokenizer = dict(
186
+ padding_side='right',
187
+ pretrained_model_name_or_path='Qwen/Qwen2.5-7B-Instruct',
188
+ trust_remote_code=True,
189
+ type='transformers.AutoTokenizer.from_pretrained')
190
+ train_cfg = dict(max_epochs=2, type='xtuner.engine.runner.TrainLoop')
191
+ train_dataloader = dict(
192
+ batch_size=1,
193
+ collate_fn=dict(type='xtuner.dataset.collate_fns.default_collate_fn'),
194
+ dataset=dict(
195
+ data_path=
196
+ '/mnt/bn/yuxuanwang/meilong/code/projects/efficient_foundation_wsi_llava/merged_dataset/stage1_morph2.json',
197
+ dataset_map_fn='xtuner.dataset.map_fns.llava_map_fn',
198
+ identifier='_224x224_b20_t15',
199
+ image_feature_prefix=
200
+ '/mnt/bn/xudong-va/meilong/datasets/Token_Compression',
201
+ image_feature_suffix='.h5',
202
+ image_folder='',
203
+ image_path_list=None,
204
+ max_length=15836,
205
+ pad_image_to_square=False,
206
+ per_image_length=10240,
207
+ sample_num=10240,
208
+ sample_strategy='linspace',
209
+ template_map_fn=dict(
210
+ template='xtuner.utils.PROMPT_TEMPLATE.qwen_chat',
211
+ type='xtuner.dataset.map_fns.template_map_fn_factory'),
212
+ tokenizer=dict(
213
+ padding_side='right',
214
+ pretrained_model_name_or_path='Qwen/Qwen2.5-7B-Instruct',
215
+ trust_remote_code=True,
216
+ type='transformers.AutoTokenizer.from_pretrained'),
217
+ type='xtuner.dataset.LLaVADataset',
218
+ unwanted_prefix_csv=
219
+ '/mnt/bn/yuxuanwang/meilong/code/projects/efficient_foundation_wsi_llava/merged_dataset/missing_slides3.csv'
220
+ ),
221
+ num_workers=10,
222
+ persistent_workers=True,
223
+ pin_memory=True,
224
+ prefetch_factor=4,
225
+ sampler=dict(shuffle=True, type='mmengine.dataset.DefaultSampler'))
226
+ visualizer = None
227
+ warmup_ratio = 0.08
228
+ weight_decay = 0.0
229
+ work_dir = '/mnt/bn/yuxuanwang/meilong/code/projects/efficient_foundation_wsi_llava/checkpoints/stage_1/token_merge_plus_resampler/'
stage_1/token_merge_plus_resampler/20250924_184838/vis_data/eval_outputs_iter_10239.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ Eval output 1:
2
+ <|im_start|>user
3
+ <image>
4
+ Are the tumor cells organized in a lobulated pattern within the slide?<|im_end|>
5
+ <|im_start|>assistant
6
+ Yes, the tumor cells are organized in a lobulated pattern within the slide.<|im_end|>
7
+
8
+
stage_1/token_merge_plus_resampler/20250924_184838/vis_data/eval_outputs_iter_15359.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ Eval output 1:
2
+ <|im_start|>user
3
+ <image>
4
+ Are the tumor cells organized in a lobulated pattern within the slide?<|im_end|>
5
+ <|im_start|>assistant
6
+ Yes, the tumor cells are organized in a lobulated pattern within the slide.<|im_end|>
7
+
8
+
stage_1/token_merge_plus_resampler/20250924_184838/vis_data/eval_outputs_iter_20479.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ Eval output 1:
2
+ <|im_start|>user
3
+ <image>
4
+ Are the tumor cells organized in a lobulated pattern within the slide?<|im_end|>
5
+ <|im_start|>assistant
6
+ Yes, the tumor cells are organized in a lobulated pattern within the slide.<|im_end|>
7
+
8
+
stage_1/token_merge_plus_resampler/20250924_184838/vis_data/eval_outputs_iter_23095.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ Eval output 1:
2
+ <|im_start|>user
3
+ <image>
4
+ Are the tumor cells organized in a lobulated pattern within the slide?<|im_end|>
5
+ <|im_start|>assistant
6
+ Yes, the tumor cells are organized in a lobulated pattern within the slide.<|im_end|>
7
+
8
+
stage_1/token_merge_plus_resampler/20250924_184838/vis_data/eval_outputs_iter_5119.txt ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Eval output 1:
2
+ <|im_start|>user
3
+ <image>
4
+ Are the tumor cells organized in a lobulated pattern within the slide?<|im_end|>
5
+ <|im_start|>assistant
6
+ Based on the information provided, the correct answer is:
7
+
8
+ A: The tumor cells are organized in a lobulated pattern within the slide.
9
+
10
+ This answer is correct because:
11
+
12
+ 1. The lobulated pattern is a characteristic feature of invasive ductal carcinoma (IDC) of the breast. In this pattern, the tumor cells form irregular, rounded masses or nodules that are separated by normal breast tissue.
13
+
14
+ 2. Lobulation refers to the formation of rounded, irregularly shaped masses that are separated by intervening normal tissue. This is a hallmark of invasive carcinoma, distinguishing it from in situ carcinoma (DCIS) which typically shows a cribriform or microlobulated pattern.
15
+
16
+ 3. The lobulated pattern is often seen in invasive ductal carcinoma because the cancer cells invade the breast tissue, forming these irregular masses that are surrounded by normal breast tissue.
17
+
18
+ The other options can be eliminated:
19
+ - A lobulated pattern is not characteristic of DCIS, which typically shows a cribriform or microlobulated pattern.
20
+ - A solid pattern would be more indicative of a poorly differentiated carcinoma or a sarcoma.
21
+ - A cribriform pattern is seen in DCIS, not invasive carcinoma.
22
+ - A microlobulated pattern is also seen in DCIS, not invasive carcinoma.
23
+
24
+ Therefore, the correct answer is A. The tumor cells are organized in a lobulated pattern within the slide.
25
+
26
+ The correct answer is A. The tumor cells are organized in a lobulated pattern within the slide.
27
+
28
+ This answer is correct because the lobulated pattern is a characteristic feature of invasive ductal carcinoma (IDC) of the breast, where the tumor cells form irregular, rounded masses or nodules that are separated by normal breast tissue. This pattern distinguishes invasive carcinoma from in situ carcinoma (DCIS), which typically shows a cribriform or microlobulated pattern. The other options describe patterns more commonly associated with other types of breast lesions or carcinomas.
29
+
30
+ The final answer is A: The tumor cells are organized in a lobulated pattern within the slide.
31
+
32
+ \boxed{A} \[The tumor cells are organized in a lobulated pattern within the slide.\] \[A\] \[The tumor cells are organized in a lobulated pattern within the slide.\] \[A\] \[The tumor cells are organized in a lobulated pattern within the slide.\] \[A\] \[The tumor cells are organized in a lobulated pattern within the slide.\] \[A\] \[The tumor cells are organized in a lobulated pattern within the slide.\] \[A\] \[The tumor cells are organized in a lobulated pattern within the slide.\] \[A\] \[The tumor cells are organized in a lobulated pattern within the slide.\] \[A\] \[The tumor cells are organized in a lobulated pattern within the slide.\] \[A\] \[The tumor cells are organized in a lobulated
33
+
34
+
stage_1/token_merge_plus_resampler/20250924_184838/vis_data/scalars.json ADDED
The diff for this file is too large to render. See raw diff