Skip to content

Conversation

@pancak3
Copy link
Contributor

@pancak3 pancak3 commented Aug 25, 2025

Reproduce: CGO_ENABLED=1 ginkgo -ldflags="-extldflags '-L/path/to/llm-d-inference-sim/lib'" -v -r -- -ginkgo.focus="Check random latencies"

click to see
Running Suite: VllmSim Suite - /workspaces/llm-d-inference-sim/pkg/llm-d-inference-sim
======================================================================================
Random Seed: 1756093008

Will run 14 of 97 specs
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
Simulator Check random latencies should calculate inter token latency correctly interTokenLatency: 1000 stddev: 300
/workspaces/llm-d-inference-sim/pkg/llm-d-inference-sim/simulator_test.go:770
  [PANICKED] in [It] - /usr/lib/golang/src/runtime/panic.go:262 @ 08/25/25 03:36:54.26
• [PANICKED] [0.003 seconds]
Simulator Check random latencies should calculate inter token latency correctly [It] interTokenLatency: 1000 stddev: 300
/workspaces/llm-d-inference-sim/pkg/llm-d-inference-sim/simulator_test.go:770

  [PANICKED] Test Panicked
  In [It] at: /usr/lib/golang/src/runtime/panic.go:262 @ 08/25/25 03:36:54.26

  runtime error: invalid memory address or nil pointer dereference

  Full Stack Trace
    math/rand.(*Rand).Int63(...)
    	/usr/lib/golang/src/math/rand/rand.go:96
    math/rand.(*Rand).Uint32(...)
    	/usr/lib/golang/src/math/rand/rand.go:99
    math/rand.(*Rand).NormFloat64(0x0)
    	/usr/lib/golang/src/math/rand/normal.go:39 +0x24
    github.com/llm-d/llm-d-inference-sim/pkg/common.RandomNorm(0x408f400000000000, 0x4072c00000000000)
    	/workspaces/llm-d-inference-sim/pkg/common/utils.go:238 +0xdc
    github.com/llm-d/llm-d-inference-sim/pkg/llm-d-inference-sim.(*VllmSimulator).getInterTokenLatency(...)
    	/workspaces/llm-d-inference-sim/pkg/llm-d-inference-sim/simulator.go:669
    github.com/llm-d/llm-d-inference-sim/pkg/llm-d-inference-sim.init.func3.18.2(0x0?, 0x0?)
    	/workspaces/llm-d-inference-sim/pkg/llm-d-inference-sim/simulator_test.go:763 +0x6c
    reflect.Value.call({0x1baf160?, 0x400051de40?, 0x13?}, {0x1e50f16, 0x4}, {0x4000848b10, 0x2, 0x2?})
    	/usr/lib/golang/src/reflect/value.go:584 +0x978
    reflect.Value.Call({0x1baf160?, 0x400051de40?, 0x2167d40?}, {0x4000848b10?, 0x0?, 0x0?})
    	/usr/lib/golang/src/reflect/value.go:368 +0x94
------------------------------
S [SKIPPED] [0.000 seconds]Running Suite: VllmSim Suite - /workspaces/llm-d-inference-sim/pkg/llm-d-inference-sim
======================================================================================
Random Seed: 1756093008

Will run 14 of 97 specs
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
Simulator Check random latencies should calculate inter token latency correctly interTokenLatency: 1000 stddev: 300
/workspaces/llm-d-inference-sim/pkg/llm-d-inference-sim/simulator_test.go:770
  [PANICKED] in [It] - /usr/lib/golang/src/runtime/panic.go:262 @ 08/25/25 03:36:54.26
• [PANICKED] [0.003 seconds]
Simulator Check random latencies should calculate inter token latency correctly [It] interTokenLatency: 1000 stddev: 300
/workspaces/llm-d-inference-sim/pkg/llm-d-inference-sim/simulator_test.go:770

  [PANICKED] Test Panicked
  In [It] at: /usr/lib/golang/src/runtime/panic.go:262 @ 08/25/25 03:36:54.26

  runtime error: invalid memory address or nil pointer dereference

  Full Stack Trace
    math/rand.(*Rand).Int63(...)
    	/usr/lib/golang/src/math/rand/rand.go:96
    math/rand.(*Rand).Uint32(...)
    	/usr/lib/golang/src/math/rand/rand.go:99
    math/rand.(*Rand).NormFloat64(0x0)
    	/usr/lib/golang/src/math/rand/normal.go:39 +0x24
    github.com/llm-d/llm-d-inference-sim/pkg/common.RandomNorm(0x408f400000000000, 0x4072c00000000000)
    	/workspaces/llm-d-inference-sim/pkg/common/utils.go:238 +0xdc
    github.com/llm-d/llm-d-inference-sim/pkg/llm-d-inference-sim.(*VllmSimulator).getInterTokenLatency(...)
    	/workspaces/llm-d-inference-sim/pkg/llm-d-inference-sim/simulator.go:669
    github.com/llm-d/llm-d-inference-sim/pkg/llm-d-inference-sim.init.func3.18.2(0x0?, 0x0?)
    	/workspaces/llm-d-inference-sim/pkg/llm-d-inference-sim/simulator_test.go:763 +0x6c
    reflect.Value.call({0x1baf160?, 0x400051de40?, 0x13?}, {0x1e50f16, 0x4}, {0x4000848b10, 0x2, 0x2?})
    	/usr/lib/golang/src/reflect/value.go:584 +0x978
    reflect.Value.Call({0x1baf160?, 0x400051de40?, 0x2167d40?}, {0x4000848b10?, 0x0?, 0x0?})
    	/usr/lib/golang/src/reflect/value.go:368 +0x94
------------------------------
S [SKIPPED] [0.000 seconds]

Added make flat to run filtered cases: make test GINKGO_FOCUS="Check random latencies"

@pancak3 pancak3 changed the title Rand generator is not set in a test suite which result in accessing nil pointer during runtime if run the only test suite Fix: Rand generator is not set in a test suite which result in accessing nil pointer during runtime if run the only test suite Aug 25, 2025
@irar2
Copy link
Collaborator

irar2 commented Aug 25, 2025

/lgtm
/approve

@github-actions github-actions bot added the lgtm label Aug 25, 2025
@github-actions github-actions bot merged commit 06f6e42 into llm-d:main Aug 25, 2025
4 checks passed
pancak3 added a commit to pancak3/llm-d-inference-sim that referenced this pull request Aug 25, 2025
…ing nil pointer during runtime if run the only test suite (llm-d#166)

* Add make flag to filter test case

Signed-off-by: Qifan Deng <[email protected]>

* Init random generator in Check random latencies test suite

Signed-off-by: Qifan Deng <[email protected]>

---------

Signed-off-by: Qifan Deng <[email protected]>
@pancak3 pancak3 deleted the dev/test branch August 25, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants