Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
6dbf9998
"src/array/cuda/negative_sampling.cu" did not exist on "01bec4a31d1a3135af33ac69cefaf7ceecbaf7b3"
Unverified
Commit
6dbf9998
authored
Mar 28, 2025
by
vikram singh shekhawat
Committed by
GitHub
Mar 27, 2025
Browse files
Fix missing arguments in SchedulePolicy and RadixCache initialization in tests. (#4712)
parent
e0166f8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
test/srt/test_schedule_policy.py
test/srt/test_schedule_policy.py
+18
-6
No files found.
test/srt/test_schedule_policy.py
View file @
6dbf9998
...
@@ -17,20 +17,30 @@ class TestSchedulePolicy(CustomTestCase):
...
@@ -17,20 +17,30 @@ class TestSchedulePolicy(CustomTestCase):
self
.
tree_cache
=
RadixCache
(
None
,
None
,
False
)
self
.
tree_cache
=
RadixCache
(
None
,
None
,
False
)
def
test_init_with_cache_aware_policy
(
self
):
def
test_init_with_cache_aware_policy
(
self
):
policy
=
SchedulePolicy
(
policy
=
"lpm"
,
tree_cache
=
self
.
tree_cache
)
policy
=
SchedulePolicy
(
policy
=
"lpm"
,
tree_cache
=
self
.
tree_cache
,
enable_hierarchical_cache
=
True
)
self
.
assertEqual
(
policy
.
policy
,
CacheAwarePolicy
.
LPM
)
self
.
assertEqual
(
policy
.
policy
,
CacheAwarePolicy
.
LPM
)
def
test_init_with_cache_agnostic_policy
(
self
):
def
test_init_with_cache_agnostic_policy
(
self
):
policy
=
SchedulePolicy
(
policy
=
"fcfs"
,
tree_cache
=
self
.
tree_cache
)
policy
=
SchedulePolicy
(
policy
=
"fcfs"
,
tree_cache
=
self
.
tree_cache
,
enable_hierarchical_cache
=
True
)
self
.
assertEqual
(
policy
.
policy
,
CacheAgnosticPolicy
.
FCFS
)
self
.
assertEqual
(
policy
.
policy
,
CacheAgnosticPolicy
.
FCFS
)
def
test_init_with_unknown_policy
(
self
):
def
test_init_with_unknown_policy
(
self
):
with
self
.
assertRaises
(
ValueError
):
with
self
.
assertRaises
(
ValueError
):
SchedulePolicy
(
policy
=
"invalid"
,
tree_cache
=
self
.
tree_cache
)
SchedulePolicy
(
policy
=
"invalid"
,
tree_cache
=
self
.
tree_cache
,
enable_hierarchical_cache
=
True
,
)
def
test_init_with_disabled_cache
(
self
):
def
test_init_with_disabled_cache
(
self
):
disabled_tree_cache
=
RadixCache
(
None
,
None
,
disable
=
True
)
disabled_tree_cache
=
RadixCache
(
None
,
None
,
disable
=
True
,
page_size
=
1
)
policy
=
SchedulePolicy
(
policy
=
"lpm"
,
tree_cache
=
disabled_tree_cache
)
policy
=
SchedulePolicy
(
policy
=
"lpm"
,
tree_cache
=
disabled_tree_cache
,
enable_hierarchical_cache
=
True
)
self
.
assertEqual
(
policy
.
policy
,
CacheAgnosticPolicy
.
FCFS
)
self
.
assertEqual
(
policy
.
policy
,
CacheAgnosticPolicy
.
FCFS
)
def
test_calc_priority_fcfs
(
self
):
def
test_calc_priority_fcfs
(
self
):
...
@@ -41,7 +51,9 @@ class TestSchedulePolicy(CustomTestCase):
...
@@ -41,7 +51,9 @@ class TestSchedulePolicy(CustomTestCase):
Req
(
2
,
"a"
,
[
1
],
SamplingParams
()),
Req
(
2
,
"a"
,
[
1
],
SamplingParams
()),
]
]
policy
=
SchedulePolicy
(
policy
=
"fcfs"
,
tree_cache
=
tree_cache
)
policy
=
SchedulePolicy
(
policy
=
"fcfs"
,
tree_cache
=
tree_cache
,
enable_hierarchical_cache
=
True
)
policy
.
calc_priority
(
waiting_queue
)
policy
.
calc_priority
(
waiting_queue
)
# Check if FCFS keeps the original order
# Check if FCFS keeps the original order
self
.
assertEqual
(
waiting_queue
[
0
].
rid
,
1
)
self
.
assertEqual
(
waiting_queue
[
0
].
rid
,
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment