You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/guide/optimization.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -142,6 +142,12 @@ results = run_grid_search(
142
142
*`result_filter`: (Optional) Callback function to filter results based on metrics.
143
143
*`warmup_calc`: (Optional) Callback function for dynamic warmup period calculation.
144
144
*`constraint`: (Optional) Callback function for parameter constraints to filter invalid combinations.
145
+
*`forward_worker_logs`: (Optional) Whether to forward worker-process `self.log()` output to the main process during parallel optimization.
146
+
*`False` (default): Better throughput, worker logs may not be visible in main process output.
147
+
*`True`: Main process aggregates worker logs, useful for debugging and teaching.
148
+
*`strict_strategy_params`: (default `True`, injected by `run_grid_search` into `run_backtest`).
149
+
* Enforces strict validation between `param_grid` keys and strategy constructor signature.
150
+
* Raises fast on unknown parameters to avoid silent fallback and distorted optimization results.
145
151
146
152
### Resource Control & Error Handling
147
153
@@ -187,6 +193,14 @@ if __name__ == "__main__":
187
193
main()
188
194
```
189
195
196
+
### Parallel Log Visibility & Warning Rules
197
+
198
+
When `max_workers > 1`, warning behavior is tied to `forward_worker_logs`:
199
+
200
+
*`forward_worker_logs=False`: warns that worker logs may not be visible in the main process.
201
+
*`forward_worker_logs=True` with active main-process logger handlers: log forwarding is enabled and visibility warning is suppressed.
202
+
*`forward_worker_logs=True` without active main-process handlers: warns that forwarding was requested but no handler is available.
203
+
190
204
### Persistence & Resume
191
205
192
206
For scenarios with extremely large parameter sets (e.g., > 10,000 combinations), running on a single machine might take days. AKQuant supports real-time result persistence to SQLite, enabling breakpoint resume.
0 commit comments