deb101 commited on
Commit
d28ddf1
·
verified ·
1 Parent(s): f58b8bd

Trained L2R token ranking model on MIMIC-IV

Browse files
config.json CHANGED
@@ -1,8 +1,7 @@
1
  {
2
- "_attn_implementation_autoset": true,
3
  "_name_or_path": "mistralai/Mistral-7B-Instruct-v0.3",
4
  "architectures": [
5
- "MistralForCausalLM"
6
  ],
7
  "attention_dropout": 0.0,
8
  "bos_token_id": 1,
@@ -15926,7 +15925,7 @@
15926
  "rope_theta": 1000000.0,
15927
  "sliding_window": null,
15928
  "tie_word_embeddings": false,
15929
- "torch_dtype": "bfloat16",
15930
  "transformers_version": "4.49.0",
15931
  "use_cache": true,
15932
  "vocab_size": 32768
 
1
  {
 
2
  "_name_or_path": "mistralai/Mistral-7B-Instruct-v0.3",
3
  "architectures": [
4
+ "LTRModel"
5
  ],
6
  "attention_dropout": 0.0,
7
  "bos_token_id": 1,
 
15925
  "rope_theta": 1000000.0,
15926
  "sliding_window": null,
15927
  "tie_word_embeddings": false,
15928
+ "torch_dtype": "float32",
15929
  "transformers_version": "4.49.0",
15930
  "use_cache": true,
15931
  "vocab_size": 32768
ground_model/adapter_config.json CHANGED
@@ -24,8 +24,8 @@
24
  "rank_pattern": {},
25
  "revision": null,
26
  "target_modules": [
27
- "v_proj",
28
  "k_proj",
 
29
  "q_proj",
30
  "o_proj"
31
  ],
 
24
  "rank_pattern": {},
25
  "revision": null,
26
  "target_modules": [
 
27
  "k_proj",
28
+ "v_proj",
29
  "q_proj",
30
  "o_proj"
31
  ],
ground_model/adapter_model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:875ad4d3f6fb36ceeb05e9ee0e3f231999529696b97ae44b1607ad0ac4991753
3
  size 54560368
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:becfd0480e4c961e227b6af3a815d48ee7eb2863205ded4ff91d1794133f96ac
3
  size 54560368
special_tokens_map.json CHANGED
@@ -13,13 +13,7 @@
13
  "rstrip": false,
14
  "single_word": false
15
  },
16
- "pad_token": {
17
- "content": "</s>",
18
- "lstrip": false,
19
- "normalized": false,
20
- "rstrip": false,
21
- "single_word": false
22
- },
23
  "unk_token": {
24
  "content": "<unk>",
25
  "lstrip": false,
 
13
  "rstrip": false,
14
  "single_word": false
15
  },
16
+ "pad_token": "</s>",
 
 
 
 
 
 
17
  "unk_token": {
18
  "content": "<unk>",
19
  "lstrip": false,
training_l2r_log_2025-06-12_16-06-10.log ADDED
@@ -0,0 +1,844 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2025-06-12 16:06:10,957 - INFO - 📝 Logging initialized. Log file created at: ../tmp/logs/training_l2r_log_2025-06-12_16-06-10.log - [learning2rank.py:287:setup_logger]
2
+ 2025-06-12 16:06:10,957 - INFO - ================================================================================ - [learning2rank.py:109:log_section]
3
+ 2025-06-12 16:06:10,957 - INFO - = 📌 INITIALIZING TRAINING ENVIRONMENT = - [learning2rank.py:110:log_section]
4
+ 2025-06-12 16:06:10,957 - INFO - ================================================================================ - [learning2rank.py:113:log_section]
5
+ 2025-06-12 16:06:10,957 - INFO - 🚀 Setting up data paths and environment variables... - [learning2rank.py:3785:main]
6
+ 2025-06-12 16:06:10,958 - INFO - 🛠️ Command-line Arguments: - [learning2rank.py:303:print_args]
7
+ 2025-06-12 16:06:10,958 - INFO -
8
+ 🔹 output_dir: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b
9
+ 🔹 source_url: XURLs.MIMIC4_DEMO
10
+ 🔹 data: mimic4_icd10_full
11
+ 🔹 data_l2r_fname_prefix: mimic4_icd10
12
+ 🔹 logfile: training_l2r_log
13
+ 🔹 base_dir: ../tmp/MIMIC4_DEMO
14
+ 🔹 l2r_boot_dir: ../tmp/MIMIC4_DEMO/mimic4_l2rboot_mistral7b
15
+ 🔹 hub_model_id: deb101/mistral-7b-instruct-v0.3-mimic4-adapt
16
+ 🔹 model_name: mistralai/Mistral-7B-Instruct-v0.3
17
+ 🔹 max_length: 512
18
+ 🔹 do_fresh_training: True
19
+ 🔹 load_from_checkpoint: False
20
+ 🔹 task: l2r
21
+ 🔹 num_train_epochs: 5
22
+ 🔹 metric_for_best_model: ndcg@25
23
+ 🔹 learning_rate: 0.0001
24
+ 🔹 warmup_steps: 0
25
+ 🔹 generate_report: False
26
+ 🔹 logfile_path: ../tmp/logs/training_l2r_log_2025-06-12_16-06-10.log
27
+ 🔹 source: /home/ubuntu/.xcube/data/mimic4_demo - [learning2rank.py:304:print_args]
28
+ 2025-06-12 16:06:10,958 - INFO - ➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖ - [learning2rank.py:305:print_args]
29
+ 2025-06-12 16:06:10,969 - INFO -
30
+ 🚀 Quick Git Info: 📁 xcube | 🌿 plant | 🔍 3ff7923 | 👤 Debjyoti Saha Roy | ⚡ MIXED (1 staged, 1 unstaged) | 🔬 git show 3ff7923 - [learning2rank.py:3796:main]
31
+ 2025-06-12 16:06:10,969 - INFO - 📁 Using L2R boot directory: ../tmp/MIMIC4_DEMO/mimic4_l2rboot_mistral7b - [learning2rank.py:3802:main]
32
+ 2025-06-12 16:06:10,969 - INFO - 📂 Using output directory: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b - [learning2rank.py:3804:main]
33
+ 2025-06-12 16:06:10,969 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:109:log_section]
34
+ 2025-06-12 16:06:10,969 - INFO - + ✨ LOADING DATASETS + - [learning2rank.py:110:log_section]
35
+ 2025-06-12 16:06:10,969 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:113:log_section]
36
+ 2025-06-12 16:06:10,969 - INFO - 📊 Loading main dataset and L2R dataset... - [learning2rank.py:3807:main]
37
+ 2025-06-12 16:06:10,969 - INFO - 📂 Loading main data from: /home/ubuntu/.xcube/data/mimic4_demo/mimic4_icd10_full.csv - [learning2rank.py:333:get_data]
38
+ 2025-06-12 16:06:19,342 - INFO - ✅ Successfully loaded main data: 122279 rows - [learning2rank.py:346:get_data]
39
+ 2025-06-12 16:06:19,342 - INFO - 📂 Loading L2R data from: ../tmp/MIMIC4_DEMO/mimic4_l2rboot_mistral7b/mimic4_icd10_tok_rank_per_lbl.ft - [learning2rank.py:352:get_data]
40
+ 2025-06-12 16:06:19,342 - INFO - 📂 Loading L2R tokens from: ../tmp/MIMIC4_DEMO/mimic4_l2rboot_mistral7b/mimic4_icd10_tok.ft - [learning2rank.py:355:get_data]
41
+ 2025-06-12 16:06:19,342 - INFO - 📂 Loading L2R labels from: ../tmp/MIMIC4_DEMO/mimic4_l2rboot_mistral7b/mimic4_icd10_lbl.ft - [learning2rank.py:358:get_data]
42
+ 2025-06-12 16:06:21,061 - INFO - ✅ Successfully loaded L2R data: 260243456 rows - [learning2rank.py:365:get_data]
43
+ 2025-06-12 16:06:21,062 - INFO - ✅ Successfully loaded L2R tokens: 32768 tokens - [learning2rank.py:366:get_data]
44
+ 2025-06-12 16:06:21,062 - INFO - ✅ Successfully loaded L2R labels: 7942 rows - [learning2rank.py:367:get_data]
45
+ 2025-06-12 16:06:21,062 - INFO - 🔄 Total data loaded: 122279 main rows, 260243456 L2R rows - [learning2rank.py:374:get_data]
46
+ 2025-06-12 16:06:21,062 - INFO - ✨ Successfully loaded both datasets: - [learning2rank.py:398:load_datasets]
47
+ 2025-06-12 16:06:21,062 - INFO - - 📄 Main dataset: 122279 records - [learning2rank.py:399:load_datasets]
48
+ 2025-06-12 16:06:21,062 - INFO - - 📄 L2R dataset: 260243456 records - [learning2rank.py:400:load_datasets]
49
+ 2025-06-12 16:06:21,062 - INFO - - 🔤 Tokens: 32768 items - [learning2rank.py:401:load_datasets]
50
+ 2025-06-12 16:06:21,062 - INFO - - 🏷️ Labels: 7942 items - [learning2rank.py:402:load_datasets]
51
+ 2025-06-12 16:06:21,069 - INFO - ✅ Data loading completed successfully - [learning2rank.py:410:load_datasets]
52
+ 2025-06-12 16:06:22,365 - INFO - ⏳ Starting quantization of ranks for DataFrame with 260243456 rows. Containing 32768 unique tokens & 7942 unique labels - [learning2rank.py:529:quantize_l2r_data]
53
+ 2025-06-12 16:06:22,367 - INFO - 🔄 Quantizing those 32768 unique token ranks into 101 quantization levels for each label - [learning2rank.py:554:quantize_l2r_data]
54
+ 2025-06-12 16:07:08,641 - INFO - ✅ Completed quantization: Produced tensor of shape torch.Size([7942, 32768, 4]) with 101 quantization levels per label - [learning2rank.py:608:quantize_l2r_data]
55
+ 2025-06-12 16:07:08,669 - WARNING - Label 6651: Only 1 tokens with top relevance score (need 50) - [learning2rank.py:724:test_scored_tokens]
56
+ 2025-06-12 16:07:08,675 - WARNING - Label 7568: Only 1 tokens with top relevance score (need 50) - [learning2rank.py:724:test_scored_tokens]
57
+ 2025-06-12 16:07:08,678 - WARNING - Label 5763: Only 1 tokens with top relevance score (need 50) - [learning2rank.py:724:test_scored_tokens]
58
+ 2025-06-12 16:07:08,682 - WARNING - Label 2284: Only 1 tokens with top relevance score (need 50) - [learning2rank.py:724:test_scored_tokens]
59
+ 2025-06-12 16:07:08,686 - WARNING - Label 4899: Only 1 tokens with top relevance score (need 50) - [learning2rank.py:724:test_scored_tokens]
60
+ 2025-06-12 16:07:08,714 - INFO - ******************************************************************************** - [learning2rank.py:109:log_section]
61
+ 2025-06-12 16:07:08,714 - INFO - * 🌟 STARTING LEARNING TO RANK MODEL TRAINING * - [learning2rank.py:110:log_section]
62
+ 2025-06-12 16:07:08,714 - INFO - ******************************************************************************** - [learning2rank.py:113:log_section]
63
+ 2025-06-12 16:07:08,714 - INFO - 🔐 Loaded authentication token from environment - [learning2rank.py:3836:main]
64
+ 2025-06-12 16:07:08,714 - INFO - 🏷️ Hub Model ID for this Learning to Rank task: deb101/mistral-7b-instruct-v0.3-mimic4-adapt-l2r - [learning2rank.py:3840:main]
65
+ 2025-06-12 16:07:08,714 - INFO - -------------------------------------------------------------------------------- - [learning2rank.py:109:log_section]
66
+ 2025-06-12 16:07:08,714 - INFO - - 📋 MODEL EXISTENCE CHECK - - [learning2rank.py:110:log_section]
67
+ 2025-06-12 16:07:08,714 - INFO - -------------------------------------------------------------------------------- - [learning2rank.py:113:log_section]
68
+ 2025-06-12 16:07:08,714 - INFO - 🔍 Checking model existence locally and on Hugging Face Hub... - [learning2rank.py:430:check_model_existence]
69
+ 2025-06-12 16:07:08,714 - INFO - ❌ Model not found locally at: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b - [learning2rank.py:437:check_model_existence]
70
+ 2025-06-12 16:07:08,760 - INFO - ✅ Model exists on Hugging Face Hub with ID: deb101/mistral-7b-instruct-v0.3-mimic4-adapt-l2r - [learning2rank.py:449:check_model_existence]
71
+ 2025-06-12 16:07:08,760 - INFO - 📁 Model exists either locally or on Hub - [learning2rank.py:475:check_model_existence]
72
+ 2025-06-12 16:07:08,760 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:109:log_section]
73
+ 2025-06-12 16:07:08,760 - INFO - + ✨ STARTING FRESH TRAINING + - [learning2rank.py:110:log_section]
74
+ 2025-06-12 16:07:08,760 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:113:log_section]
75
+ 2025-06-12 16:07:08,760 - INFO - 🔄 Starting fresh training (either forced or model not found)... - [learning2rank.py:3853:main]
76
+ 2025-06-12 16:07:08,771 - WARNING - Note: Environment variable`HF_TOKEN` is set and is the current active token independently from the token you've just configured. - [_login.py:415:_login]
77
+ 2025-06-12 16:07:08,771 - INFO - 🔑 Successfully authenticated with Hugging Face Hub - [learning2rank.py:311:authenticate_hf]
78
+ 2025-06-12 16:07:08,771 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:109:log_section]
79
+ 2025-06-12 16:07:08,771 - INFO - + ✨ LOADING BASE MODEL + - [learning2rank.py:110:log_section]
80
+ 2025-06-12 16:07:08,771 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:113:log_section]
81
+ 2025-06-12 16:07:08,771 - INFO - 📥 Loading pretrained model and tokenizer... - [learning2rank.py:3895:main]
82
+ 2025-06-12 16:07:08,771 - INFO - 🚀 Starting model and tokenizer loading process... - [learning2rank.py:939:load_base_model_and_tokenizer]
83
+ 2025-06-12 16:07:08,772 - INFO - 📊 Quantization config: BitsAndBytesConfig {
84
+ "_load_in_4bit": true,
85
+ "_load_in_8bit": false,
86
+ "bnb_4bit_compute_dtype": "bfloat16",
87
+ "bnb_4bit_quant_storage": "uint8",
88
+ "bnb_4bit_quant_type": "nf4",
89
+ "bnb_4bit_use_double_quant": true,
90
+ "llm_int8_enable_fp32_cpu_offload": false,
91
+ "llm_int8_has_fp16_weight": false,
92
+ "llm_int8_skip_modules": null,
93
+ "llm_int8_threshold": 6.0,
94
+ "load_in_4bit": true,
95
+ "load_in_8bit": false,
96
+ "quant_method": "bitsandbytes"
97
+ }
98
+ - [learning2rank.py:948:load_base_model_and_tokenizer]
99
+ 2025-06-12 16:07:08,772 - INFO - 🔤 Loading tokenizer for model: mistralai/Mistral-7B-Instruct-v0.3... - [learning2rank.py:952:load_base_model_and_tokenizer]
100
+ 2025-06-12 16:07:09,388 - INFO - 📝 Setting pad token to eos token... - [learning2rank.py:956:load_base_model_and_tokenizer]
101
+ 2025-06-12 16:07:09,388 - INFO - 🧠 Loading base model with quantization... - [learning2rank.py:964:load_base_model_and_tokenizer]
102
+ 2025-06-12 16:07:35,992 - INFO - We will use 90% of the memory on device 0 for storing the model, and 10% for the buffer to avoid OOM. You can set `max_memory` in to a higher value to use more memory (at your own risk). - [modeling.py:991:get_balanced_memory]
103
+ 2025-06-12 16:07:41,459 - INFO - 🔧 Setting up default LoRA configuration... - [learning2rank.py:987:load_base_model_and_tokenizer]
104
+ 2025-06-12 16:07:41,459 - INFO - 🔍 LoRA config: r=16, alpha=32, targets={'k_proj', 'v_proj', 'q_proj', 'o_proj'}, dropout=0.05 - [learning2rank.py:1010:load_base_model_and_tokenizer]
105
+ 2025-06-12 16:07:41,459 - INFO - 🧩 Applying LoRA adapters to model... - [learning2rank.py:1017:load_base_model_and_tokenizer]
106
+ 2025-06-12 16:07:41,639 - INFO - 📊 trainable params: 13,631,488 || all params: 7,261,655,040 || trainable%: 0.1877 - [learning2rank.py:135:log_print_output]
107
+ 2025-06-12 16:07:41,639 - INFO - ✅ Model and tokenizer successfully loaded! - [learning2rank.py:1024:load_base_model_and_tokenizer]
108
+ 2025-06-12 16:07:41,639 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:109:log_section]
109
+ 2025-06-12 16:07:41,639 - INFO - + ✨ DATA PREPROCESSING + - [learning2rank.py:110:log_section]
110
+ 2025-06-12 16:07:41,639 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:113:log_section]
111
+ 2025-06-12 16:07:41,640 - INFO - 🔄 Loading and preprocessing training data... - [learning2rank.py:3903:main]
112
+ 2025-06-12 16:07:42,835 - INFO - 🔍 Verifying uniqueness of token IDs per label in scored_tokens... - [learning2rank.py:1302:preprocess_data]
113
+ 2025-06-12 16:07:43,674 - INFO - ✅ All labels have unique token IDs in scored_tokens. - [learning2rank.py:1314:preprocess_data]
114
+ 2025-06-12 16:07:43,674 - INFO - 🚀 Building a 2D lookup table for efficient token-to-relevance mapping across all labels! 🚀 - [learning2rank.py:1317:preprocess_data]
115
+ 2025-06-12 16:07:43,674 - INFO - 🔢 Total labels = 7942 - [learning2rank.py:1320:preprocess_data]
116
+ 2025-06-12 16:07:43,674 - INFO - 🔍 Precomputing token indices and corresponding relevance_values for each label... - [learning2rank.py:1321:preprocess_data]
117
+ 2025-06-12 16:07:44,005 - INFO - 📊 Lookup table dimensions: 32768 vocabulary size × 7942 labels - [learning2rank.py:1328:preprocess_data]
118
+ 2025-06-12 16:07:44,005 - INFO - ⚡ This approach eliminates token comparison broadcasting and provides O(1) lookup time for relevance scores! - [learning2rank.py:1331:preprocess_data]
119
+ 2025-06-12 16:07:44,005 - INFO - 🧮 Processing relevance calculations vectorized for maximum speed 🔥 - [learning2rank.py:1334:preprocess_data]
120
+ 2025-06-12 16:07:44,167 - INFO - 🔍 Verifying token mappings with 10 samples... - [learning2rank.py:1367:verify_token_mappings]
121
+ 2025-06-12 16:07:44,331 - INFO - ✅ Token mappings verification completed successfully! 🎉 - [learning2rank.py:1458:verify_token_mappings]
122
+ 2025-06-12 16:07:44,335 - INFO - 🔄 Processing dataset with map... - [learning2rank.py:1522:preprocess_data]
123
+ 2025-06-12 16:07:44,652 - INFO - ✅ Dataset built in 0h 0m 0.32s - [learning2rank.py:1545:preprocess_data]
124
+ 2025-06-12 16:07:44,663 - INFO - The size of Training set: 173 🏋️ (Training Data) - [learning2rank.py:1576:preprocess_data]
125
+ 2025-06-12 16:07:44,663 - INFO - The size of Evaluation set: 35 🔍 (Test Data) - [learning2rank.py:1577:preprocess_data]
126
+ 2025-06-12 16:07:44,664 - INFO - 🚀 Created HuggingFace Dataset with 208 samples, 7942 labels - [learning2rank.py:1585:preprocess_data]
127
+ 2025-06-12 16:07:44,664 - INFO - 🏷️ Number of unique ICD-10 codes: 7942 - [learning2rank.py:3916:main]
128
+ 2025-06-12 16:07:44,664 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:109:log_section]
129
+ 2025-06-12 16:07:44,664 - INFO - + ✨ MODEL INITIALIZATION + - [learning2rank.py:110:log_section]
130
+ 2025-06-12 16:07:44,664 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:113:log_section]
131
+ 2025-06-12 16:07:44,665 - INFO - 🧠 Initializing custom L2R model for outputting per-token relevance scores per ICD-10 codes. - [learning2rank.py:3919:main]
132
+ 2025-06-12 16:07:46,228 - INFO - 🔧 Registering LTRModel with transformers AutoModel 🚀 - [learning2rank.py:1725:define_model]
133
+ 2025-06-12 16:07:46,228 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:109:log_section]
134
+ 2025-06-12 16:07:46,228 - INFO - + ✨ TRAINING PREPARATION + - [learning2rank.py:110:log_section]
135
+ 2025-06-12 16:07:46,228 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:113:log_section]
136
+ 2025-06-12 16:07:46,228 - INFO - ⚙️ Preparing training components and optimizers... - [learning2rank.py:3926:main]
137
+ 2025-06-12 16:07:46,260 - INFO - 🖥️ Device: NVIDIA GH200 480GB - [learning2rank.py:1887:log_training_configuration]
138
+ 2025-06-12 16:07:46,260 - INFO - 🔋 CUDA Available: True - [learning2rank.py:1890:log_training_configuration]
139
+ 2025-06-12 16:07:46,260 - INFO - 💾 CUDA Device Count: 1 - [learning2rank.py:1891:log_training_configuration]
140
+ 2025-06-12 16:07:46,261 - INFO -
141
+ 📋 Training Configuration 📋
142
+ +----------+-----------------------------+--------------------------------------------------+
143
+ | 🌟 Emoji | 🏷️ Parameter | 📊 Value |
144
+ +----------+-----------------------------+--------------------------------------------------+
145
+ | 📁 | Output Directory | ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b |
146
+ | 🔁 | Training Epochs | 5 |
147
+ | 🏋️ | Train Batch Size | 1 |
148
+ | 🔍 | Eval Batch Size | 1 |
149
+ | 📊 | Gradient Accumulation Steps | 4 |
150
+ | 🚀 | Learning Rate | 0.0001 |
151
+ | 🌅 | Warmup Steps | 0 |
152
+ | 💾 | Save Strategy | epoch |
153
+ | 💾 | Save Total Limit | 10 |
154
+ | 📊 | Evaluation Strategy | epoch |
155
+ | 🎯 | Best Model Metric | ndcg@25 |
156
+ | 📝 | Logging Strategy | steps (every 10 steps) |
157
+ | 🌐 | Push to Hub | True |
158
+ | 🌐 | Hub Model ID | deb101/mistral-7b-instruct-v0.3-mimic4-adapt-l2r |
159
+ | 🔢 | Steps per Epoch | 43 |
160
+ | 🔢 | Total Training Steps | 215 |
161
+ | 🔢 | Evaluation Steps | 35 |
162
+ | 📊 | Training Dataset Size | 173 samples 🏋️ |
163
+ | 📊 | Evaluation Dataset Size | 35 samples 🔍 |
164
+ +----------+-----------------------------+--------------------------------------------------+ - [learning2rank.py:1879:log_training_args]
165
+ 2025-06-12 16:07:46,261 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:109:log_section]
166
+ 2025-06-12 16:07:46,261 - INFO - + ✨ MODEL TRAINING + - [learning2rank.py:110:log_section]
167
+ 2025-06-12 16:07:46,261 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:113:log_section]
168
+ 2025-06-12 16:07:46,261 - INFO - 🏋️ Starting model training process... - [learning2rank.py:3946:main]
169
+ 2025-06-12 16:07:46,262 - INFO - 🏁 Preparing Custom Trainer 🛠️ - [learning2rank.py:3084:train_model]
170
+ 2025-06-12 16:07:46,312 - INFO - We are registering the tokenizer mistralai/Mistral-7B-Instruct-v0.3 in Custom Trainer - [learning2rank.py:2519:__init__]
171
+ 2025-06-12 16:07:46,312 - INFO - 🏋️ Commencing Model Training 💪 - [learning2rank.py:3125:train_model]
172
+ 2025-06-12 16:07:46,575 - INFO - 🚀 Starting Training... - [learning2rank.py:2269:on_train_begin]
173
+ 2025-06-12 16:08:07,762 - INFO -
174
+ 🚂 Training Metrics (Step 10) 🚂
175
+ +---------------+--------------+
176
+ | Metric | Value |
177
+ +===============+==============+
178
+ | loss | -4.62965e+16 |
179
+ +---------------+--------------+
180
+ | grad_norm | nan |
181
+ +---------------+--------------+
182
+ | learning_rate | 0.0001 |
183
+ +---------------+--------------+
184
+ | epoch | 0.231214 |
185
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
186
+ 2025-06-12 16:08:21,668 - INFO -
187
+ 🚂 Training Metrics (Step 20) 🚂
188
+ +---------------+--------------+
189
+ | Metric | Value |
190
+ +===============+==============+
191
+ | loss | -5.01649e+17 |
192
+ +---------------+--------------+
193
+ | grad_norm | nan |
194
+ +---------------+--------------+
195
+ | learning_rate | 0.0001 |
196
+ +---------------+--------------+
197
+ | epoch | 0.462428 |
198
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
199
+ 2025-06-12 16:08:35,600 - INFO -
200
+ ��� Training Metrics (Step 30) 🚂
201
+ +---------------+--------------+
202
+ | Metric | Value |
203
+ +===============+==============+
204
+ | loss | -6.47564e+16 |
205
+ +---------------+--------------+
206
+ | grad_norm | nan |
207
+ +---------------+--------------+
208
+ | learning_rate | 0.0001 |
209
+ +---------------+--------------+
210
+ | epoch | 0.693642 |
211
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
212
+ 2025-06-12 16:08:49,511 - INFO -
213
+ 🚂 Training Metrics (Step 40) 🚂
214
+ +---------------+--------------+
215
+ | Metric | Value |
216
+ +===============+==============+
217
+ | loss | -1.11402e+18 |
218
+ +---------------+--------------+
219
+ | grad_norm | nan |
220
+ +---------------+--------------+
221
+ | learning_rate | 0.0001 |
222
+ +---------------+--------------+
223
+ | epoch | 0.924855 |
224
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
225
+ 2025-06-12 16:08:54,038 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [learning2rank.py:2635:evaluate]
226
+ 2025-06-12 16:12:09,400 - WARNING - No valid samples found for metric 'precision@25'. - [learning2rank.py:2739:evaluate]
227
+ 2025-06-12 16:12:09,400 - INFO -
228
+ 🔍 Evaluation Metrics 🔍
229
+ +-------------------+--------------+
230
+ | Metric | Value |
231
+ +===================+==============+
232
+ | eval_loss | -1.09312e+17 |
233
+ +-------------------+--------------+
234
+ | eval_ndcg | 0.95547 |
235
+ +-------------------+--------------+
236
+ | eval_ndcg@25 | 0.211187 |
237
+ +-------------------+--------------+
238
+ | eval_precision@25 | 0 |
239
+ +-------------------+--------------+ - [learning2rank.py:2206:on_evaluate]
240
+ 2025-06-12 16:12:10,616 - INFO - 💾 Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-44 - [learning2rank.py:2759:_save]
241
+ 2025-06-12 16:12:10,644 - INFO - ⚙️ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-44 - [learning2rank.py:2764:_save]
242
+ 2025-06-12 16:12:10,645 - INFO - 📋 Saved files in ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-44:
243
+ +---------+-------------------+------------+
244
+ | Index | Saved File | Size |
245
+ +=========+===================+============+
246
+ | 1 | training_args.bin | 0.01 MB |
247
+ +---------+-------------------+------------+
248
+ | 2 | model.safetensors | 4122.74 MB |
249
+ +---------+-------------------+------------+
250
+ | 3 | config.json | 0.38 MB |
251
+ +---------+-------------------+------------+ - [learning2rank.py:2785:_save]
252
+ 2025-06-12 16:12:23,933 - INFO -
253
+ 🚂 Training Metrics (Step 50) 🚂
254
+ +---------------+-------------+
255
+ | Metric | Value |
256
+ +===============+=============+
257
+ | loss | -5.4984e+18 |
258
+ +---------------+-------------+
259
+ | grad_norm | nan |
260
+ +---------------+-------------+
261
+ | learning_rate | 0.0001 |
262
+ +---------------+-------------+
263
+ | epoch | 1.13873 |
264
+ +---------------+-------------+ - [learning2rank.py:2187:on_log]
265
+ 2025-06-12 16:12:38,072 - INFO -
266
+ 🚂 Training Metrics (Step 60) 🚂
267
+ +---------------+--------------+
268
+ | Metric | Value |
269
+ +===============+==============+
270
+ | loss | -1.25805e+17 |
271
+ +---------------+--------------+
272
+ | grad_norm | nan |
273
+ +---------------+--------------+
274
+ | learning_rate | 9.9e-05 |
275
+ +---------------+--------------+
276
+ | epoch | 1.36994 |
277
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
278
+ 2025-06-12 16:12:52,113 - INFO -
279
+ 🚂 Training Metrics (Step 70) 🚂
280
+ +---------------+--------------+
281
+ | Metric | Value |
282
+ +===============+==============+
283
+ | loss | -6.72455e+18 |
284
+ +---------------+--------------+
285
+ | grad_norm | 1.61598e+18 |
286
+ +---------------+--------------+
287
+ | learning_rate | 9.5e-05 |
288
+ +---------------+--------------+
289
+ | epoch | 1.60116 |
290
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
291
+ 2025-06-12 16:13:06,160 - INFO -
292
+ 🚂 Training Metrics (Step 80) 🚂
293
+ +---------------+--------------+
294
+ | Metric | Value |
295
+ +===============+==============+
296
+ | loss | -9.71864e+16 |
297
+ +---------------+--------------+
298
+ | grad_norm | 1.35972e+18 |
299
+ +---------------+--------------+
300
+ | learning_rate | 9e-05 |
301
+ +---------------+--------------+
302
+ | epoch | 1.83237 |
303
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
304
+ 2025-06-12 16:13:16,350 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [learning2rank.py:2635:evaluate]
305
+ 2025-06-12 16:16:30,965 - INFO -
306
+ 🔍 Evaluation Metrics 🔍
307
+ +-------------------+--------------+
308
+ | Metric | Value |
309
+ +===================+==============+
310
+ | eval_loss | -3.32416e+17 |
311
+ +-------------------+--------------+
312
+ | eval_ndcg | 0.956174 |
313
+ +-------------------+--------------+
314
+ | eval_ndcg@25 | 0.783363 |
315
+ +-------------------+--------------+
316
+ | eval_precision@25 | 0.592 |
317
+ +-------------------+--------------+ - [learning2rank.py:2206:on_evaluate]
318
+ 2025-06-12 16:16:32,184 - INFO - 💾 Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-88 - [learning2rank.py:2759:_save]
319
+ 2025-06-12 16:16:32,211 - INFO - ⚙️ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-88 - [learning2rank.py:2764:_save]
320
+ 2025-06-12 16:16:32,212 - INFO - 📋 Saved files in ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-88:
321
+ +---------+-------------------+------------+
322
+ | Index | Saved File | Size |
323
+ +=========+===================+============+
324
+ | 1 | training_args.bin | 0.01 MB |
325
+ +---------+-------------------+------------+
326
+ | 2 | model.safetensors | 4122.74 MB |
327
+ +---------+-------------------+------------+
328
+ | 3 | config.json | 0.38 MB |
329
+ +---------+-------------------+------------+ - [learning2rank.py:2785:_save]
330
+ 2025-06-12 16:16:39,991 - INFO -
331
+ 🚂 Training Metrics (Step 90) 🚂
332
+ +---------------+--------------+
333
+ | Metric | Value |
334
+ +===============+==============+
335
+ | loss | -9.18515e+17 |
336
+ +---------------+--------------+
337
+ | grad_norm | 3.7135e+17 |
338
+ +---------------+--------------+
339
+ | learning_rate | 8.6e-05 |
340
+ +---------------+--------------+
341
+ | epoch | 2.04624 |
342
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
343
+ 2025-06-12 16:16:54,151 - INFO -
344
+ 🚂 Training Metrics (Step 100) 🚂
345
+ +---------------+--------------+
346
+ | Metric | Value |
347
+ +===============+==============+
348
+ | loss | -2.22409e+17 |
349
+ +---------------+--------------+
350
+ | grad_norm | 5.69918e+17 |
351
+ +---------------+--------------+
352
+ | learning_rate | 8.2e-05 |
353
+ +---------------+--------------+
354
+ | epoch | 2.27746 |
355
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
356
+ 2025-06-12 16:17:08,253 - INFO -
357
+ 🚂 Training Metrics (Step 110) 🚂
358
+ +---------------+--------------+
359
+ | Metric | Value |
360
+ +===============+==============+
361
+ | loss | -4.82911e+18 |
362
+ +---------------+--------------+
363
+ | grad_norm | nan |
364
+ +---------------+--------------+
365
+ | learning_rate | 7.8e-05 |
366
+ +---------------+--------------+
367
+ | epoch | 2.50867 |
368
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
369
+ 2025-06-12 16:17:22,332 - INFO -
370
+ 🚂 Training Metrics (Step 120) 🚂
371
+ +---------------+--------------+
372
+ | Metric | Value |
373
+ +===============+==============+
374
+ | loss | -4.16614e+17 |
375
+ +---------------+--------------+
376
+ | grad_norm | 9.5413e+17 |
377
+ +---------------+--------------+
378
+ | learning_rate | 7.3e-05 |
379
+ +---------------+--------------+
380
+ | epoch | 2.73988 |
381
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
382
+ 2025-06-12 16:17:36,355 - INFO -
383
+ 🚂 Training Metrics (Step 130) 🚂
384
+ +---------------+--------------+
385
+ | Metric | Value |
386
+ +===============+==============+
387
+ | loss | -1.33031e+18 |
388
+ +---------------+--------------+
389
+ | grad_norm | 3.89503e+17 |
390
+ +---------------+--------------+
391
+ | learning_rate | 6.9e-05 |
392
+ +---------------+--------------+
393
+ | epoch | 2.9711 |
394
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
395
+ 2025-06-12 16:17:38,126 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [learning2rank.py:2635:evaluate]
396
+ 2025-06-12 16:20:52,762 - INFO -
397
+ 🔍 Evaluation Metrics 🔍
398
+ +-------------------+--------------+
399
+ | Metric | Value |
400
+ +===================+==============+
401
+ | eval_loss | -3.91117e+17 |
402
+ +-------------------+--------------+
403
+ | eval_ndcg | 0.956926 |
404
+ +-------------------+--------------+
405
+ | eval_ndcg@25 | 0.82168 |
406
+ +-------------------+--------------+
407
+ | eval_precision@25 | 0.908571 |
408
+ +-------------------+--------------+ - [learning2rank.py:2206:on_evaluate]
409
+ 2025-06-12 16:20:53,956 - INFO - 💾 Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-132 - [learning2rank.py:2759:_save]
410
+ 2025-06-12 16:20:53,984 - INFO - ⚙️ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-132 - [learning2rank.py:2764:_save]
411
+ 2025-06-12 16:20:53,985 - INFO - 📋 Saved files in ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-132:
412
+ +---------+-------------------+------------+
413
+ | Index | Saved File | Size |
414
+ +=========+===================+============+
415
+ | 1 | training_args.bin | 0.01 MB |
416
+ +---------+-------------------+------------+
417
+ | 2 | model.safetensors | 4122.74 MB |
418
+ +---------+-------------------+------------+
419
+ | 3 | config.json | 0.38 MB |
420
+ +---------+-------------------+------------+ - [learning2rank.py:2785:_save]
421
+ 2025-06-12 16:21:10,341 - INFO -
422
+ 🚂 Training Metrics (Step 140) 🚂
423
+ +---------------+--------------+
424
+ | Metric | Value |
425
+ +===============+==============+
426
+ | loss | -1.11577e+19 |
427
+ +---------------+--------------+
428
+ | grad_norm | 1.39227e+17 |
429
+ +---------------+--------------+
430
+ | learning_rate | 6.5e-05 |
431
+ +---------------+--------------+
432
+ | epoch | 3.18497 |
433
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
434
+ 2025-06-12 16:21:24,410 - INFO -
435
+ 🚂 Training Metrics (Step 150) 🚂
436
+ +---------------+--------------+
437
+ | Metric | Value |
438
+ +===============+==============+
439
+ | loss | -6.83761e+18 |
440
+ +---------------+--------------+
441
+ | grad_norm | 2.31929e+17 |
442
+ +---------------+--------------+
443
+ | learning_rate | 6.1e-05 |
444
+ +---------------+--------------+
445
+ | epoch | 3.41619 |
446
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
447
+ 2025-06-12 16:21:38,506 - INFO -
448
+ 🚂 Training Metrics (Step 160) 🚂
449
+ +---------------+-------------+
450
+ | Metric | Value |
451
+ +===============+=============+
452
+ | loss | -4.9145e+17 |
453
+ +---------------+-------------+
454
+ | grad_norm | 1.76402e+17 |
455
+ +---------------+-------------+
456
+ | learning_rate | 5.6e-05 |
457
+ +---------------+-------------+
458
+ | epoch | 3.6474 |
459
+ +---------------+-------------+ - [learning2rank.py:2187:on_log]
460
+ 2025-06-12 16:21:52,575 - INFO -
461
+ 🚂 Training Metrics (Step 170) 🚂
462
+ +---------------+--------------+
463
+ | Metric | Value |
464
+ +===============+==============+
465
+ | loss | -3.55019e+17 |
466
+ +---------------+--------------+
467
+ | grad_norm | 2.18249e+17 |
468
+ +---------------+--------------+
469
+ | learning_rate | 5.2e-05 |
470
+ +---------------+--------------+
471
+ | epoch | 3.87861 |
472
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
473
+ 2025-06-12 16:21:59,986 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [learning2rank.py:2635:evaluate]
474
+ 2025-06-12 16:25:14,540 - INFO -
475
+ 🔍 Evaluation Metrics 🔍
476
+ +-------------------+-------------+
477
+ | Metric | Value |
478
+ +===================+=============+
479
+ | eval_loss | -4.1582e+17 |
480
+ +-------------------+-------------+
481
+ | eval_ndcg | 0.957027 |
482
+ +-------------------+-------------+
483
+ | eval_ndcg@25 | 0.882935 |
484
+ +-------------------+-------------+
485
+ | eval_precision@25 | 0.936 |
486
+ +-------------------+-------------+ - [learning2rank.py:2206:on_evaluate]
487
+ 2025-06-12 16:25:15,741 - INFO - 💾 Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-176 - [learning2rank.py:2759:_save]
488
+ 2025-06-12 16:25:15,768 - INFO - ⚙️ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-176 - [learning2rank.py:2764:_save]
489
+ 2025-06-12 16:25:15,769 - INFO - 📋 Saved files in ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-176:
490
+ +---------+-------------------+------------+
491
+ | Index | Saved File | Size |
492
+ +=========+===================+============+
493
+ | 1 | training_args.bin | 0.01 MB |
494
+ +---------+-------------------+------------+
495
+ | 2 | model.safetensors | 4122.74 MB |
496
+ +---------+-------------------+------------+
497
+ | 3 | config.json | 0.38 MB |
498
+ +---------+-------------------+------------+ - [learning2rank.py:2785:_save]
499
+ 2025-06-12 16:25:26,433 - INFO -
500
+ 🚂 Training Metrics (Step 180) 🚂
501
+ +---------------+--------------+
502
+ | Metric | Value |
503
+ +===============+==============+
504
+ | loss | -1.75372e+18 |
505
+ +---------------+--------------+
506
+ | grad_norm | 4.73633e+16 |
507
+ +---------------+--------------+
508
+ | learning_rate | 4.7e-05 |
509
+ +---------------+--------------+
510
+ | epoch | 4.09249 |
511
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
512
+ 2025-06-12 16:25:40,570 - INFO -
513
+ 🚂 Training Metrics (Step 190) 🚂
514
+ +---------------+-------------+
515
+ | Metric | Value |
516
+ +===============+=============+
517
+ | loss | -1.5025e+18 |
518
+ +---------------+-------------+
519
+ | grad_norm | 8.75016e+18 |
520
+ +---------------+-------------+
521
+ | learning_rate | 4.2e-05 |
522
+ +---------------+-------------+
523
+ | epoch | 4.3237 |
524
+ +---------------+-------------+ - [learning2rank.py:2187:on_log]
525
+ 2025-06-12 16:25:54,677 - INFO -
526
+ 🚂 Training Metrics (Step 200) 🚂
527
+ +---------------+--------------+
528
+ | Metric | Value |
529
+ +===============+==============+
530
+ | loss | -7.62265e+17 |
531
+ +---------------+--------------+
532
+ | grad_norm | 2.16831e+17 |
533
+ +---------------+--------------+
534
+ | learning_rate | 3.8e-05 |
535
+ +---------------+--------------+
536
+ | epoch | 4.55491 |
537
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
538
+ 2025-06-12 16:26:08,706 - INFO -
539
+ 🚂 Training Metrics (Step 210) 🚂
540
+ +---------------+--------------+
541
+ | Metric | Value |
542
+ +===============+==============+
543
+ | loss | -4.55473e+18 |
544
+ +---------------+--------------+
545
+ | grad_norm | 1.28445e+17 |
546
+ +---------------+--------------+
547
+ | learning_rate | 3.3e-05 |
548
+ +---------------+--------------+
549
+ | epoch | 4.78613 |
550
+ +---------------+--------------+ - [learning2rank.py:2187:on_log]
551
+ 2025-06-12 16:26:16,943 - INFO - 💾 Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-215 - [learning2rank.py:2759:_save]
552
+ 2025-06-12 16:26:16,971 - INFO - ⚙️ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-215 - [learning2rank.py:2764:_save]
553
+ 2025-06-12 16:26:16,972 - INFO - 📋 Saved files in ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-215:
554
+ +---------+-------------------+------------+
555
+ | Index | Saved File | Size |
556
+ +=========+===================+============+
557
+ | 1 | training_args.bin | 0.01 MB |
558
+ +---------+-------------------+------------+
559
+ | 2 | model.safetensors | 4122.74 MB |
560
+ +---------+-------------------+------------+
561
+ | 3 | config.json | 0.38 MB |
562
+ +---------+-------------------+------------+ - [learning2rank.py:2785:_save]
563
+ 2025-06-12 16:26:17,187 - INFO - Removing 'token_type_ids' from eval_dataset as they are not needed. - [learning2rank.py:2635:evaluate]
564
+ 2025-06-12 16:29:31,588 - INFO -
565
+ 🔍 Evaluation Metrics 🔍
566
+ +-------------------+--------------+
567
+ | Metric | Value |
568
+ +===================+==============+
569
+ | eval_loss | -4.38159e+17 |
570
+ +-------------------+--------------+
571
+ | eval_ndcg | 0.957099 |
572
+ +-------------------+--------------+
573
+ | eval_ndcg@25 | 0.884317 |
574
+ +-------------------+--------------+
575
+ | eval_precision@25 | 0.963429 |
576
+ +-------------------+--------------+ - [learning2rank.py:2206:on_evaluate]
577
+ 2025-06-12 16:29:35,126 - INFO - 💾 Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-215 - [learning2rank.py:2759:_save]
578
+ 2025-06-12 16:29:35,154 - INFO - ⚙️ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-215 - [learning2rank.py:2764:_save]
579
+ 2025-06-12 16:29:35,155 - INFO - 📋 Saved files in ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-215:
580
+ +---------+--------------------+------------+
581
+ | Index | Saved File | Size |
582
+ +=========+====================+============+
583
+ | 1 | training_args.bin | 0.01 MB |
584
+ +---------+--------------------+------------+
585
+ | 2 | optimizer.pt | 352.39 MB |
586
+ +---------+--------------------+------------+
587
+ | 3 | model.safetensors | 4122.74 MB |
588
+ +---------+--------------------+------------+
589
+ | 4 | scaler.pt | 0.00 MB |
590
+ +---------+--------------------+------------+
591
+ | 5 | config.json | 0.38 MB |
592
+ +---------+--------------------+------------+
593
+ | 6 | scheduler.pt | 0.00 MB |
594
+ +---------+--------------------+------------+
595
+ | 7 | trainer_state.json | 0.01 MB |
596
+ +---------+--------------------+------------+
597
+ | 8 | rng_state.pth | 0.01 MB |
598
+ +---------+--------------------+------------+ - [learning2rank.py:2785:_save]
599
+ 2025-06-12 16:29:35,672 - INFO - 📂 Loading best model from ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-215 - [learning2rank.py:2841:_load_best_model]
600
+ 2025-06-12 16:29:35,673 - INFO - 🖥️ Model is on device: cuda:0 - [learning2rank.py:2851:_load_best_model]
601
+ 2025-06-12 16:29:35,730 - INFO - 🔑 Key order comparison:
602
+ +---------+--------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
603
+ | Index | Saved state_dict Keys | Model state_dict Keys |
604
+ +=========+==========================================================================+===========================================================================================+
605
+ | 1 | ground_model.base_model.model.lm_head.weight | label_embeddings.weight |
606
+ +---------+--------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
607
+ | 2 | ground_model.base_model.model.model.embed_tokens.weight | ground_model.base_model.model.model.embed_tokens.weight |
608
+ +---------+--------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
609
+ | 3 | ground_model.base_model.model.model.layers.0.input_layernorm.weight | ground_model.base_model.model.model.layers.0.self_attn.q_proj.base_layer.weight |
610
+ +---------+--------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
611
+ | 4 | ground_model.base_model.model.model.layers.0.mlp.down_proj.weight | ground_model.base_model.model.model.layers.0.self_attn.q_proj.base_layer.weight.absmax |
612
+ +---------+--------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+
613
+ | 5 | ground_model.base_model.model.model.layers.0.mlp.down_proj.weight.absmax | ground_model.base_model.model.model.layers.0.self_attn.q_proj.base_layer.weight.quant_map |
614
+ +---------+--------------------------------------------------------------------------+-------------------------------------------------------------------------------------------+ - [learning2rank.py:2875:_load_best_model]
615
+ 2025-06-12 16:29:36,544 - INFO - ✅ Loaded best model weights from ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/checkpoint-215/model.safetensors - [learning2rank.py:2892:_load_best_model]
616
+ 2025-06-12 16:29:36,586 - INFO - ✔️ Weight for label_embeddings.weight matches between saved and loaded state_dict - [learning2rank.py:2904:_load_best_model]
617
+ 2025-06-12 16:29:36,640 - INFO - ✔️ Weight for ground_model.base_model.model.model.embed_tokens.weight matches between saved and loaded state_dict - [learning2rank.py:2904:_load_best_model]
618
+ 2025-06-12 16:29:36,658 - INFO -
619
+ 🚂 Training Metrics (Step 215) 🚂
620
+ +--------------------------+-------------+
621
+ | Metric | Value |
622
+ +==========================+=============+
623
+ | train_runtime | 1310.09 |
624
+ +--------------------------+-------------+
625
+ | train_samples_per_second | 0.66 |
626
+ +--------------------------+-------------+
627
+ | train_steps_per_second | 0.164 |
628
+ +--------------------------+-------------+
629
+ | total_flos | 9.47661e+15 |
630
+ +--------------------------+-------------+
631
+ | train_loss | -2.6129e+18 |
632
+ +--------------------------+-------------+
633
+ | epoch | 4.90173 |
634
+ +--------------------------+-------------+ - [learning2rank.py:2187:on_log]
635
+ 2025-06-12 16:29:36,659 - INFO - ✨ Training Completed! ✨ - [learning2rank.py:2336:on_train_end]
636
+ 2025-06-12 16:29:36,740 - INFO - 📊 Training loss plot saved as '../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/train_loss_plot.png' - [learning2rank.py:2439:on_train_end]
637
+ 2025-06-12 16:29:36,802 - INFO - 📊 Evaluation loss plot saved as '../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/eval_loss_plot.png' - [learning2rank.py:2453:on_train_end]
638
+ 2025-06-12 16:29:36,864 - INFO - 📊 Evaluation metric plot saved as '../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/eval_ndcg@25_plot.png' - [learning2rank.py:2474:on_train_end]
639
+ 2025-06-12 16:29:36,864 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:109:log_section]
640
+ 2025-06-12 16:29:36,864 - INFO - + ✨ MODEL SAVING + - [learning2rank.py:110:log_section]
641
+ 2025-06-12 16:29:36,864 - INFO - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - [learning2rank.py:113:log_section]
642
+ 2025-06-12 16:29:36,864 - INFO - 💾 Saving trained model and pushing to Hugging Face Hub... - [learning2rank.py:3961:main]
643
+ 2025-06-12 16:29:36,865 - INFO - 📁 Creating/using output directory: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b - [learning2rank.py:3159:save_and_push]
644
+ 2025-06-12 16:29:38,074 - INFO - 💾 Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b - [learning2rank.py:2759:_save]
645
+ 2025-06-12 16:29:38,101 - INFO - ⚙️ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b - [learning2rank.py:2764:_save]
646
+ 2025-06-12 16:29:38,104 - INFO - 📋 Saved files in ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b:
647
+ +---------+-----------------------------------+------------+
648
+ | Index | Saved File | Size |
649
+ +=========+===================================+============+
650
+ | 1 | eval_loss_plot.png | 0.03 MB |
651
+ +---------+-----------------------------------+------------+
652
+ | 2 | training_args.bin | 0.01 MB |
653
+ +---------+-----------------------------------+------------+
654
+ | 3 | model.safetensors | 4122.74 MB |
655
+ +---------+-----------------------------------+------------+
656
+ | 4 | eval_ndcg@25_plot.png | 0.03 MB |
657
+ +---------+-----------------------------------+------------+
658
+ | 5 | config.json | 0.38 MB |
659
+ +---------+-----------------------------------+------------+
660
+ | 6 | train_loss_plot.png | 0.04 MB |
661
+ +---------+-----------------------------------+------------+
662
+ | 7 | checkpoint-44/training_args.bin | 0.01 MB |
663
+ +---------+-----------------------------------+------------+
664
+ | 8 | checkpoint-44/optimizer.pt | 0.00 MB |
665
+ +---------+-----------------------------------+------------+
666
+ | 9 | checkpoint-44/model.safetensors | 4122.74 MB |
667
+ +---------+-----------------------------------+------------+
668
+ | 10 | checkpoint-44/scaler.pt | 0.00 MB |
669
+ +---------+-----------------------------------+------------+
670
+ | 11 | checkpoint-44/config.json | 0.38 MB |
671
+ +---------+-----------------------------------+------------+
672
+ | 12 | checkpoint-44/scheduler.pt | 0.00 MB |
673
+ +---------+-----------------------------------+------------+
674
+ | 13 | checkpoint-44/trainer_state.json | 0.00 MB |
675
+ +---------+-----------------------------------+------------+
676
+ | 14 | checkpoint-44/rng_state.pth | 0.01 MB |
677
+ +---------+-----------------------------------+------------+
678
+ | 15 | checkpoint-176/training_args.bin | 0.01 MB |
679
+ +---------+-----------------------------------+------------+
680
+ | 16 | checkpoint-176/optimizer.pt | 352.39 MB |
681
+ +---------+-----------------------------------+------------+
682
+ | 17 | checkpoint-176/model.safetensors | 4122.74 MB |
683
+ +---------+-----------------------------------+------------+
684
+ | 18 | checkpoint-176/scaler.pt | 0.00 MB |
685
+ +---------+-----------------------------------+------------+
686
+ | 19 | checkpoint-176/config.json | 0.38 MB |
687
+ +---------+-----------------------------------+------------+
688
+ | 20 | checkpoint-176/scheduler.pt | 0.00 MB |
689
+ +---------+-----------------------------------+------------+
690
+ | 21 | checkpoint-176/trainer_state.json | 0.00 MB |
691
+ +---------+-----------------------------------+------------+
692
+ | 22 | checkpoint-176/rng_state.pth | 0.01 MB |
693
+ +---------+-----------------------------------+------------+
694
+ | 23 | checkpoint-215/training_args.bin | 0.01 MB |
695
+ +---------+-----------------------------------+------------+
696
+ | 24 | checkpoint-215/optimizer.pt | 352.39 MB |
697
+ +---------+-----------------------------------+------------+
698
+ | 25 | checkpoint-215/model.safetensors | 4122.74 MB |
699
+ +---------+-----------------------------------+------------+
700
+ | 26 | checkpoint-215/scaler.pt | 0.00 MB |
701
+ +---------+-----------------------------------+------------+
702
+ | 27 | checkpoint-215/config.json | 0.38 MB |
703
+ +---------+-----------------------------------+------------+
704
+ | 28 | checkpoint-215/scheduler.pt | 0.00 MB |
705
+ +---------+-----------------------------------+------------+
706
+ | 29 | checkpoint-215/trainer_state.json | 0.01 MB |
707
+ +---------+-----------------------------------+------------+
708
+ | 30 | checkpoint-215/rng_state.pth | 0.01 MB |
709
+ +---------+-----------------------------------+------------+
710
+ | 31 | checkpoint-88/training_args.bin | 0.01 MB |
711
+ +---------+-----------------------------------+------------+
712
+ | 32 | checkpoint-88/optimizer.pt | 352.39 MB |
713
+ +---------+-----------------------------------+------------+
714
+ | 33 | checkpoint-88/model.safetensors | 4122.74 MB |
715
+ +---------+-----------------------------------+------------+
716
+ | 34 | checkpoint-88/scaler.pt | 0.00 MB |
717
+ +---------+-----------------------------------+------------+
718
+ | 35 | checkpoint-88/config.json | 0.38 MB |
719
+ +---------+-----------------------------------+------------+
720
+ | 36 | checkpoint-88/scheduler.pt | 0.00 MB |
721
+ +---------+-----------------------------------+------------+
722
+ | 37 | checkpoint-88/trainer_state.json | 0.00 MB |
723
+ +---------+-----------------------------------+------------+
724
+ | 38 | checkpoint-88/rng_state.pth | 0.01 MB |
725
+ +---------+-----------------------------------+------------+
726
+ | 39 | checkpoint-132/training_args.bin | 0.01 MB |
727
+ +---------+-----------------------------------+------------+
728
+ | 40 | checkpoint-132/optimizer.pt | 352.39 MB |
729
+ +---------+-----------------------------------+------------+
730
+ | 41 | checkpoint-132/model.safetensors | 4122.74 MB |
731
+ +---------+-----------------------------------+------------+
732
+ | 42 | checkpoint-132/scaler.pt | 0.00 MB |
733
+ +---------+-----------------------------------+------------+
734
+ | 43 | checkpoint-132/config.json | 0.38 MB |
735
+ +---------+-----------------------------------+------------+
736
+ | 44 | checkpoint-132/scheduler.pt | 0.00 MB |
737
+ +---------+-----------------------------------+------------+
738
+ | 45 | checkpoint-132/trainer_state.json | 0.00 MB |
739
+ +---------+-----------------------------------+------------+
740
+ | 46 | checkpoint-132/rng_state.pth | 0.01 MB |
741
+ +---------+-----------------------------------+------------+ - [learning2rank.py:2785:_save]
742
+ 2025-06-12 16:29:41,852 - INFO - 💾 Model weights saved in safetensors format: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b - [learning2rank.py:2759:_save]
743
+ 2025-06-12 16:29:41,880 - INFO - ⚙️ Config saved in checkpoint: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b - [learning2rank.py:2764:_save]
744
+ 2025-06-12 16:29:41,883 - INFO - 📋 Saved files in ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b:
745
+ +---------+-----------------------------------+------------+
746
+ | Index | Saved File | Size |
747
+ +=========+===================================+============+
748
+ | 1 | eval_loss_plot.png | 0.03 MB |
749
+ +---------+-----------------------------------+------------+
750
+ | 2 | training_args.bin | 0.01 MB |
751
+ +---------+-----------------------------------+------------+
752
+ | 3 | model.safetensors | 4122.74 MB |
753
+ +---------+-----------------------------------+------------+
754
+ | 4 | eval_ndcg@25_plot.png | 0.03 MB |
755
+ +---------+-----------------------------------+------------+
756
+ | 5 | config.json | 0.38 MB |
757
+ +---------+-----------------------------------+------------+
758
+ | 6 | train_loss_plot.png | 0.04 MB |
759
+ +---------+-----------------------------------+------------+
760
+ | 7 | checkpoint-44/training_args.bin | 0.01 MB |
761
+ +---------+-----------------------------------+------------+
762
+ | 8 | checkpoint-44/optimizer.pt | 0.00 MB |
763
+ +---------+-----------------------------------+------------+
764
+ | 9 | checkpoint-44/model.safetensors | 4122.74 MB |
765
+ +---------+-----------------------------------+------------+
766
+ | 10 | checkpoint-44/scaler.pt | 0.00 MB |
767
+ +---------+-----------------------------------+------------+
768
+ | 11 | checkpoint-44/config.json | 0.38 MB |
769
+ +---------+-----------------------------------+------------+
770
+ | 12 | checkpoint-44/scheduler.pt | 0.00 MB |
771
+ +---------+-----------------------------------+------------+
772
+ | 13 | checkpoint-44/trainer_state.json | 0.00 MB |
773
+ +---------+-----------------------------------+------------+
774
+ | 14 | checkpoint-44/rng_state.pth | 0.01 MB |
775
+ +---------+-----------------------------------+------------+
776
+ | 15 | checkpoint-176/training_args.bin | 0.01 MB |
777
+ +---------+-----------------------------------+------------+
778
+ | 16 | checkpoint-176/optimizer.pt | 352.39 MB |
779
+ +---------+-----------------------------------+------------+
780
+ | 17 | checkpoint-176/model.safetensors | 4122.74 MB |
781
+ +---------+-----------------------------------+------------+
782
+ | 18 | checkpoint-176/scaler.pt | 0.00 MB |
783
+ +---------+-----------------------------------+------------+
784
+ | 19 | checkpoint-176/config.json | 0.38 MB |
785
+ +---------+-----------------------------------+------------+
786
+ | 20 | checkpoint-176/scheduler.pt | 0.00 MB |
787
+ +---------+-----------------------------------+------------+
788
+ | 21 | checkpoint-176/trainer_state.json | 0.00 MB |
789
+ +---------+-----------------------------------+------------+
790
+ | 22 | checkpoint-176/rng_state.pth | 0.01 MB |
791
+ +---------+-----------------------------------+------------+
792
+ | 23 | checkpoint-215/training_args.bin | 0.01 MB |
793
+ +---------+-----------------------------------+------------+
794
+ | 24 | checkpoint-215/optimizer.pt | 352.39 MB |
795
+ +---------+-----------------------------------+------------+
796
+ | 25 | checkpoint-215/model.safetensors | 4122.74 MB |
797
+ +---------+-----------------------------------+------------+
798
+ | 26 | checkpoint-215/scaler.pt | 0.00 MB |
799
+ +---------+-----------------------------------+------------+
800
+ | 27 | checkpoint-215/config.json | 0.38 MB |
801
+ +---------+-----------------------------------+------------+
802
+ | 28 | checkpoint-215/scheduler.pt | 0.00 MB |
803
+ +---------+-----------------------------------+------------+
804
+ | 29 | checkpoint-215/trainer_state.json | 0.01 MB |
805
+ +---------+-----------------------------------+------------+
806
+ | 30 | checkpoint-215/rng_state.pth | 0.01 MB |
807
+ +---------+-----------------------------------+------------+
808
+ | 31 | checkpoint-88/training_args.bin | 0.01 MB |
809
+ +---------+-----------------------------------+------------+
810
+ | 32 | checkpoint-88/optimizer.pt | 352.39 MB |
811
+ +---------+-----------------------------------+------------+
812
+ | 33 | checkpoint-88/model.safetensors | 4122.74 MB |
813
+ +---------+-----------------------------------+------------+
814
+ | 34 | checkpoint-88/scaler.pt | 0.00 MB |
815
+ +---------+-----------------------------------+------------+
816
+ | 35 | checkpoint-88/config.json | 0.38 MB |
817
+ +---------+-----------------------------------+------------+
818
+ | 36 | checkpoint-88/scheduler.pt | 0.00 MB |
819
+ +---------+-----------------------------------+------------+
820
+ | 37 | checkpoint-88/trainer_state.json | 0.00 MB |
821
+ +---------+-----------------------------------+------------+
822
+ | 38 | checkpoint-88/rng_state.pth | 0.01 MB |
823
+ +---------+-----------------------------------+------------+
824
+ | 39 | checkpoint-132/training_args.bin | 0.01 MB |
825
+ +---------+-----------------------------------+------------+
826
+ | 40 | checkpoint-132/optimizer.pt | 352.39 MB |
827
+ +---------+-----------------------------------+------------+
828
+ | 41 | checkpoint-132/model.safetensors | 4122.74 MB |
829
+ +---------+-----------------------------------+------------+
830
+ | 42 | checkpoint-132/scaler.pt | 0.00 MB |
831
+ +---------+-----------------------------------+------------+
832
+ | 43 | checkpoint-132/config.json | 0.38 MB |
833
+ +---------+-----------------------------------+------------+
834
+ | 44 | checkpoint-132/scheduler.pt | 0.00 MB |
835
+ +---------+-----------------------------------+------------+
836
+ | 45 | checkpoint-132/trainer_state.json | 0.00 MB |
837
+ +---------+-----------------------------------+------------+
838
+ | 46 | checkpoint-132/rng_state.pth | 0.01 MB |
839
+ +---------+-----------------------------------+------------+ - [learning2rank.py:2785:_save]
840
+ 2025-06-12 16:31:17,468 - INFO - 💾 Model saved to: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b - [learning2rank.py:3163:save_and_push]
841
+ 2025-06-12 16:31:21,819 - INFO - ✅ Model, ground_model, and lookup_table saved to ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b - [core.py:401:save_pretrained]
842
+ 2025-06-12 16:31:21,820 - INFO - 💾 Model and config explicitly saved to: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b - [learning2rank.py:3169:save_and_push]
843
+ 2025-06-12 16:31:21,851 - INFO - 🖌️ Tokenizer saved to: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b - [learning2rank.py:3173:save_and_push]
844
+ 2025-06-12 16:31:22,726 - INFO - 📊 Lookup table saved to: ../tmp/MIMIC4_DEMO/mimic4_l2rtrain_mistral7b/lookup_table.pt - [learning2rank.py:3178:save_and_push]