thealper2/graphcodebert-code-clone-detection
011
1{2 "model_name": "microsoft/graphcodebert-base",3 "model_dir": "/mnt/d/work2/graphcodebert-code-clone-detection/models/graphcodebert-clone-detection",4 "dataset_name": "PoolC/1-fold-clone-detection-600k-5fold",5 "dataset_split_strategy": {6 "train_split": "train",7 "heldout_split": "val",8 "note": "The repository provides one of 5 predefined folds as `train` + `val`; those groups are disjoint and are kept as-is. `val` is partitioned further into validation/test along problem-group boundaries.",9 "heldout_groups": 59,10 "validation_groups": 29,11 "test_groups": 30,12 "dropped_cross_boundary_pairs": 337398,13 "validation": {14 "num_examples": 483738,15 "negatives_label_0": 157558,16 "positives_label_1": 326180,17 "positive_ratio": 0.674291,18 "num_groups": 2919 },20 "test": {21 "num_examples": 503224,22 "negatives_label_0": 167224,23 "positives_label_1": 336000,24 "positive_ratio": 0.667695,25 "num_groups": 3026 }27 },28 "num_train_examples": 50000,29 "num_validation_examples": 20000,30 "num_test_examples": 20000,31 "class_distributions": {32 "train": {33 "num_examples": 50000,34 "negatives_label_0": 25000,35 "positives_label_1": 25000,36 "positive_ratio": 0.5,37 "num_groups": 24038 },39 "validation": {40 "num_examples": 20000,41 "negatives_label_0": 10000,42 "positives_label_1": 10000,43 "positive_ratio": 0.5,44 "num_groups": 2945 },46 "test": {47 "num_examples": 20000,48 "negatives_label_0": 10000,49 "positives_label_1": 10000,50 "positive_ratio": 0.5,51 "num_groups": 3052 }53 },54 "class_weighting": {55 "mode": "auto",56 "threshold": 0.6,57 "majority_class_share": 0.5,58 "applied": false,59 "weights": null,60 "reason": "Measured majority-class share 0.5000 is within the 0.6 threshold, so weighted cross entropy is NOT used."61 },62 "sequence_length": 512,63 "data_flow_length": 128,64 "total_sequence_length": 640,65 "per_device_train_batch_size": 16,66 "gradient_accumulation_steps": 1,67 "effective_batch_size": 16,68 "learning_rate": 2e-05,69 "num_train_epochs": 3.0,70 "optimizer": "adamw_torch",71 "scheduler": "linear",72 "warmup_ratio": 0.1,73 "warmup_steps": 938,74 "weight_decay": 0.01,75 "max_grad_norm": 1.0,76 "mixed_precision": "fp16",77 "gradient_checkpointing": false,78 "seed": 42,79 "training_time_seconds": 6921.9,80 "training_time_hours": 1.923,81 "train_runtime_metrics": {82 "train_runtime": 6918.8074,83 "train_samples_per_second": 21.68,84 "train_steps_per_second": 1.355,85 "total_flos": 0.0,86 "train_loss": 0.43145505716959637,87 "epoch": 3.088 },89 "gpu": {90 "cuda_available": true,91 "torch_version": "2.11.0+cu128",92 "transformers_version": "5.17.0",93 "python_version": "3.12.3",94 "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",95 "gpu_name": "NVIDIA GeForce RTX 5060 Ti",96 "gpu_count": 1,97 "gpu_total_memory_gb": 15.9,98 "gpu_capability": "12.0",99 "cuda_version": "12.8"100 },101 "parameters": {102 "trainable_parameters": 125236994,103 "total_parameters": 125236994104 },105 "best_validation_f1": 0.8671882190520018,106 "best_checkpoint": "./outputs/checkpoint-9000",107 "validation_metrics": {108 "loss": 0.34459105134010315,109 "accuracy": 0.8557,110 "precision": 0.8032395566922421,111 "recall": 0.9422,112 "f1": 0.8671882190520018,113 "macro_f1": 0.8546121719233737,114 "tp": 9422,115 "tn": 7692,116 "fp": 2308,117 "fn": 578,118 "confusion_matrix": [119 [120 7692,121 2308122 ],123 [124 578,125 9422126 ]127 ],128 "confusion_matrix_layout": "[[TN, FP], [FN, TP]]",129 "support": {130 "num_examples": 20000,131 "label_0": 10000,132 "label_1": 10000133 },134 "runtime": 173.9737,135 "samples_per_second": 114.96,136 "steps_per_second": 3.592,137 "num_examples": 20000,138 "eval_seconds": 174.0139 },140 "test_metrics": {141 "loss": 0.3165612816810608,142 "model_preparation_time": 0.0022,143 "accuracy": 0.87465,144 "precision": 0.8409939018840448,145 "recall": 0.924,146 "f1": 0.8805450993472149,147 "macro_f1": 0.874343974488208,148 "tp": 9240,149 "tn": 8253,150 "fp": 1747,151 "fn": 760,152 "confusion_matrix": [153 [154 8253,155 1747156 ],157 [158 760,159 9240160 ]161 ],162 "confusion_matrix_layout": "[[TN, FP], [FN, TP]]",163 "support": {164 "num_examples": 20000,165 "label_0": 10000,166 "label_1": 10000167 },168 "runtime": 181.6455,169 "samples_per_second": 110.105,170 "steps_per_second": 3.441,171 "num_examples": 20000,172 "eval_seconds": 181.7173 },174 "preprocessing": {175 "snippet_pool": {176 "num_unique_snippets": 44950,177 "scan_seconds": 46.3,178 "snippets_with_multiple_groups": 1,179 "cross_split_snippet_overlap": {180 "train|val:snippets": 0,181 "train|val:groups": 0182 },183 "per_split": {184 "train": {185 "num_examples": 5388622,186 "negatives_label_0": 2694311,187 "positives_label_1": 2694311,188 "positive_ratio": 0.5,189 "num_groups": 240190 },191 "val": {192 "num_examples": 1324360,193 "negatives_label_0": 662180,194 "positives_label_1": 662180,195 "positive_ratio": 0.5,196 "num_groups": 59197 }198 }199 },200 "feature_extraction": {201 "num_snippets": 44950,202 "extraction_seconds": 64.1,203 "status_counts": {204 "ok": 44930,205 "comment_strip_failed": 13,206 "dfg_failed": 7207 },208 "snippets_with_empty_dataflow": 263,209 "dataflow_nodes_mean": 44.22,210 "dataflow_nodes_p50": 33,211 "dataflow_nodes_p95": 127,212 "dataflow_nodes_max": 193,213 "code_tokens_mean": 137.9,214 "code_tokens_truncated": 885,215 "total_dataflow_edges": 2481388,216 "sequence_length": 640217 },218 "subsampling": {219 "train": {220 "subsampled": true,221 "kept": 50000,222 "balanced": true223 },224 "validation": {225 "subsampled": true,226 "kept": 20000,227 "balanced": true228 },229 "test": {230 "subsampled": true,231 "kept": 20000,232 "balanced": true233 }234 }235 },236 "sanity_check": {237 "passed": true,238 "device": "cuda",239 "checks": [240 {241 "check": "1_dataset_loading",242 "passed": true,243 "detail": "train=50000 val=20000 test=20000"244 },245 {246 "check": "2_column_detection",247 "passed": true,248 "detail": "code columns=code1/code2, label=similar; excluded from features: ['code1_group', 'code2_group', 'pair_id', 'question_pair_id']"249 },250 {251 "check": "3_label_correctness",252 "passed": true,253 "detail": "labels in {0,1}; validation positive ratio=0.5"254 },255 {256 "check": "4_tokenisation",257 "passed": true,258 "detail": "<s>...</s> wrapping OK, 93 code tokens, decodes to 'import math a , b , c = map ( int , input ( ) . split ( ) ) '"259 },260 {261 "check": "5_dataflow_extraction",262 "passed": true,263 "detail": "44687/44950 snippets have a non-empty data-flow graph, 2481388 edges, mean nodes=44.22"264 },265 {266 "check": "6_attention_mask",267 "passed": true,268 "detail": "shape=(640, 640) (code_length 512 + data_flow_length 128), 93 code tokens, 30 nodes, density=0.0215, padding rows empty"269 },270 {271 "check": "7_forward_pass",272 "passed": true,273 "detail": "logits shape=(16, 2) for batch of 16 pairs; mask tensor=(16, 640, 640)"274 },275 {276 "check": "8_finite_loss",277 "passed": true,278 "detail": "loss=0.6978 (chance level ~0.6931)"279 },280 {281 "check": "9_training_step",282 "passed": true,283 "detail": "loss=0.6798, grad_norm=2.4929, weights updated (amp=on, dtype=torch.float16)"284 }285 ],286 "parameters": {287 "trainable_parameters": 125236994,288 "total_parameters": 125236994289 },290 "sequence_length": 640291 },292 "test_metrics_provenance": {293 "note": "Re-scored after fixing a transformers v5 dataloader-caching bug: Trainer.get_eval_dataloader caches under the key 'eval' when a Dataset object is passed and dataloader_persistent_workers=True, so the original in-training test evaluation silently re-scored the validation split. evaluate_split now uses Trainer.predict and verifies the returned labels.",294 "superseded_test_f1": 0.8671882190520018,295 "corrected_test_f1": 0.8805450993472149,296 "validation_f1_unchanged": 0.8671882190520018297 }298}