File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 33
44import torch
55import torch .nn as nn
6- import triton .runtime .driver as driver
76import vllm .v1 .sample .rejection_sampler as rs
87from vllm .triton_utils import HAS_TRITON , tl , triton
98from vllm .v1 .sample .metadata import SamplingMetadata
1817# step. This value is chosen to be large enough to handle typical use cases.
1918MAX_SPEC_LEN = 32
2019
21- device_properties = driver .active .utils .get_device_properties (torch .npu .current_device ())
22- vectorcore_num = device_properties ['num_vectorcore' ]
20+
21+ vectorcore_num = None
22+ device_properties = None
23+
24+
25+ if HAS_TRITON :
26+ from triton .runtime import driver
27+ device_properties = driver .active .utils .get_device_properties (torch .npu .current_device ())
28+ vectorcore_num = device_properties ['num_vectorcore' ]
2329#get vector core number in order for later tiling
2430
31+
2532class AscendRejectionSampler (RejectionSampler , nn .Module ):
2633 """
2734 The implementation strictly follows the algorithm described in
You can’t perform that action at this time.
0 commit comments