mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-06-01 01:37:04 +08:00
wip
Signed-off-by: Amir Samani <asamani@nvidia.com>
This commit is contained in:
parent
695d78c471
commit
dfb5ce44dc
@ -166,7 +166,7 @@ class TestCUDAGraphWrapper:
|
|||||||
self.model, self.vllm_config, runtime_mode=CUDAGraphMode.FULL
|
self.model, self.vllm_config, runtime_mode=CUDAGraphMode.FULL
|
||||||
)
|
)
|
||||||
batch_descriptor = BatchDescriptor(num_tokens=10)
|
batch_descriptor = BatchDescriptor(num_tokens=10)
|
||||||
|
stream = torch.cuda.Stream()
|
||||||
# 0. global warmup
|
# 0. global warmup
|
||||||
with (
|
with (
|
||||||
set_forward_context(
|
set_forward_context(
|
||||||
@ -175,7 +175,7 @@ class TestCUDAGraphWrapper:
|
|||||||
cudagraph_runtime_mode=CUDAGraphMode.NONE,
|
cudagraph_runtime_mode=CUDAGraphMode.NONE,
|
||||||
batch_descriptor=None,
|
batch_descriptor=None,
|
||||||
),
|
),
|
||||||
graph_capture(device=torch.device("cuda")) as graph_ctx,
|
torch.cuda.stream(stream),
|
||||||
):
|
):
|
||||||
wrapper(self.input_tensor)
|
wrapper(self.input_tensor)
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ class TestCUDAGraphWrapper:
|
|||||||
batch_descriptor=batch_descriptor,
|
batch_descriptor=batch_descriptor,
|
||||||
),
|
),
|
||||||
patch("torch.cuda.graph", wraps=torch.cuda.graph) as mock_cuda_graph,
|
patch("torch.cuda.graph", wraps=torch.cuda.graph) as mock_cuda_graph,
|
||||||
graph_capture(device=torch.device("cuda")) as graph_ctx,
|
torch.cuda.stream(stream),
|
||||||
):
|
):
|
||||||
output1 = wrapper(self.input_tensor)
|
output1 = wrapper(self.input_tensor)
|
||||||
# capturing phase should generate a zero output
|
# capturing phase should generate a zero output
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user