Skip to content

Commit c06e934

Browse files
committed
Simplifying the linear mapping based on Nikhil's comment
1 parent c781b7c commit c06e934

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/notebooks/memory_estimator_example.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"#### The Unfreeze Rank Ratio\n",
112112
"\n",
113113
"This is the OSFT parameter that determines what proportion of the parameters can be updated\n",
114-
"during the OSFT fine-tuning step. Setting this to 0.33 should give you an estimation similar to SFT,\n",
114+
"during the OSFT fine-tuning step. Setting this to 1/3 should give you an estimation similar to SFT,\n",
115115
"and setting this to 1 should you give you an estimation about twice as large as SFT's"
116116
]
117117
},

src/training_hub/profiling/memory_estimator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def ROUNDER(value: int) -> str: return str(round(value / 1073741824, 1))
1818

1919
# Helper function to calculate how much the given unfrozen_rank_ratio
2020
# will be affecting the OSFT estimation (through a quadratic mapping where
21-
# 0 is 0.25 of SFT's value, 0.33 is equal to SFT's value, and 1 is twice of SFT's value)
22-
def OSFT_RATIO(value: float) -> float: return -0.7802 * (value) * (value) + 2.5302 * (value) + 0.25
21+
# 0 is 0.5 of SFT's value, 1/3 is equal to SFT's value, and 1 is twice of SFT's value)
22+
def OSFT_RATIO(value: float) -> float: return 0.5 + (1.5 * value)
2323

2424

2525
class BasicEstimator:

0 commit comments

Comments
 (0)