Skip to content

Number of paths, steps, and speed ​

After finishing this section, you will know where the time for one prediction goes, and you will be able to tune --paths, --steps, and --precision to suitable values based on your own GPU and needs.

Where the time goes: number of paths × steps ​

As the previous lesson said: each path starts from a blob of noise, and the model takes a step, takes a look, then takes another step. So the number of times the model has to compute is roughly:

Number of paths K × steps

The defaults are K=16 and steps=32, which is 512 times. Increase K to 64, and the time becomes roughly 4 times as long.

Measured: RTX 4080 SUPER 16GB ​

Official 2.84-hundred-million-parameter model (284 million parameters), a single example, --chunk 48 (the automatic value for a 16GB GPU). Other programs were also running on the same card, so only look at the relative sizes of the numbers:

GranularityPrecisionKstepsTimePeak VRAM
1hbf161681.0 sec2.1 GB
1hbf1616323.7 sec2.1 GB
1hbf16643216.9 sec3.0 GB
1hbf162563270.0 sec3.1 GB
1hfp3216325.4 sec1.6 GB
1mbf16163215.2 sec3.1 GB
1mbf16643260.8 sec5.9 GB
1mfp32643289.7 sec5.6 GB

Three patterns:

  1. Time is proportional to K × steps. 16→64 paths, 3.7→16.9 sec.
  2. 1-minute bars are the most expensive. It has to look at 1200 bars and draw 120 bars at a time, so the sequence is more than three times as long as the 1-hour bars.
  3. bf16 is about 30% faster than fp32. When a GPU is present, the script defaults to bf16.

How to choose each parameter ​

Look it upI want to...

Click one to see.

Try it: same example, different number of paths ​

bash
python eval/infer_for_pred.py --case 300733.SZ,1h,"2026-02-09 15:00" --paths 64 --out results/k64

You should see the time go from just over 3 seconds to a dozen or so seconds (we measured 16.9 seconds). The median of the endpoints will differ from the 16-path run, which is normal: with more paths, the computed median and interval are more stable, and the interval is what matters.

There is one more parameter, --solver heun: it computes an extra correction step at each step (Heun's method), roughly doubling the number of model computations. The default euler is what the paper used.

Quiz timeTo compress a 1-hour-candle prediction from about 4 seconds to about 1 second, the most direct approach is?

Check yourself ​

  • I know the runtime is roughly proportional to "number of paths × steps"
  • I ran it once with --paths 64 and looked at how the interval changed
  • When VRAM runs out, I know to adjust --chunk first

Next section: Evaluation and backtesting.

gaodong.aiAboutPrivacyContact

Independent tutorials, not affiliated with any product mentioned. Product names and trademarks belong to their owners. Check official pages for prices and policies.