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
jerrrrry
infinilm
Commits
30e93254
Commit
30e93254
authored
Mar 09, 2026
by
MaYuhang
Browse files
issue/257 fix(llm): sync inference service with FLA engine interface changes
parent
70561bd9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
python/infinilm/llm/llm.py
python/infinilm/llm/llm.py
+4
-4
python/infinilm/llm/scheduler.py
python/infinilm/llm/scheduler.py
+4
-0
python/infinilm/llm/static_scheduler.py
python/infinilm/llm/static_scheduler.py
+1
-0
No files found.
python/infinilm/llm/llm.py
View file @
30e93254
...
...
@@ -223,16 +223,16 @@ class LLMEngine:
if
value
is
None
:
# Skip None values (block_tables/slot_mapping for static cache)
model_input
[
key
]
=
None
elif
key
in
[
"input_ids"
,
"position_ids"
,
"slot_mapping"
]:
model_input
[
key
]
=
infinicore
.
from_list
(
value
,
dtype
=
infinicore
.
int64
)
elif
key
in
[
"input_ids"
,
"position_ids"
,
"past_kv_lengths"
,
"total_kv_lengths"
,
"input_offsets"
,
"
slot_mapping
"
,
"
cu_seqlens
"
,
"block_tables"
,
]:
model_input
[
key
]
=
infinicore
.
from_list
(
value
,
dtype
=
infinicore
.
int
64
)
model_input
[
key
]
=
infinicore
.
from_list
(
value
,
dtype
=
infinicore
.
int
32
)
else
:
# temperature, top_k, top_p, etc.
model_input
[
key
]
=
value
...
...
python/infinilm/llm/scheduler.py
View file @
30e93254
...
...
@@ -101,6 +101,9 @@ class SchedulerOutput:
max_block_table_len
-
len
(
req
.
block_table
)
)
block_tables
.
append
(
padded_block_table
)
cu_seqlens
=
[
0
]
for
l
in
seq_lens
:
cu_seqlens
.
append
(
cu_seqlens
[
-
1
]
+
l
)
return
{
"input_ids"
:
[
tokens
],
...
...
@@ -108,6 +111,7 @@ class SchedulerOutput:
"past_kv_lengths"
:
cached_lens
,
"total_kv_lengths"
:
seq_lens
,
"input_offsets"
:
seq_offsets
,
"cu_seqlens"
:
cu_seqlens
,
"block_tables"
:
block_tables
,
"slot_mapping"
:
slot_mapping
,
"temperature"
:
temperature
,
...
...
python/infinilm/llm/static_scheduler.py
View file @
30e93254
...
...
@@ -75,6 +75,7 @@ class StaticSchedulerOutput:
"past_kv_lengths"
:
[
past_kv_len
],
"total_kv_lengths"
:
[
total_kv_len
],
"input_offsets"
:
input_offsets
,
"cu_seqlens"
:
[
0
,
total_kv_len
],
"block_tables"
:
None
,
"slot_mapping"
:
None
,
"temperature"
:
temperature
,
...
...
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