File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 11import Foundation
22import Hub
3+ import MLX
34import MLXLLM
45import MLXLMCommon
56import MLXVLM
@@ -38,6 +39,9 @@ struct ModelLoadingBenchmarks {
3839 print ( " LLM load run \( i) : \( String ( format: " %.0f " , elapsed) ) ms " )
3940
4041 _ = modelContext // silence unused warning
42+
43+ // Clear GPU cache to ensure independent measurements
44+ GPU . clearCache ( )
4145 }
4246
4347 let avg = times. reduce ( 0 , + ) / Double( times. count)
@@ -72,6 +76,9 @@ struct ModelLoadingBenchmarks {
7276 print ( " VLM load run \( i) : \( String ( format: " %.0f " , elapsed) ) ms " )
7377
7478 _ = modelContext // silence unused warning
79+
80+ // Clear GPU cache to ensure independent measurements
81+ GPU . clearCache ( )
7582 }
7683
7784 let avg = times. reduce ( 0 , + ) / Double( times. count)
You can’t perform that action at this time.
0 commit comments