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
429f54cd
Commit
429f54cd
authored
Jan 30, 2026
by
PanZezhong
Committed by
wooway777
Feb 10, 2026
Browse files
issue/143 init input to support warmup
parent
21274f33
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
csrc/engine/compiler/paged_compiler.cpp
csrc/engine/compiler/paged_compiler.cpp
+7
-0
csrc/engine/compiler/static_batching_compiler.cpp
csrc/engine/compiler/static_batching_compiler.cpp
+2
-0
No files found.
csrc/engine/compiler/paged_compiler.cpp
View file @
429f54cd
...
...
@@ -33,7 +33,14 @@ void PagedCompiler::compile() {
input
.
input_ids
=
infinicore
::
Tensor
::
empty
({
1
,
b
},
infinicore
::
DataType
::
I64
,
infinicore
::
context
::
getDevice
());
input
.
position_ids
=
infinicore
::
Tensor
::
empty
({
b
},
infinicore
::
DataType
::
I64
,
infinicore
::
context
::
getDevice
());
input
.
total_sequence_lengths
=
infinicore
::
Tensor
::
empty
({
b
},
infinicore
::
DataType
::
I64
,
infinicore
::
context
::
getDevice
());
std
::
vector
<
int64_t
>
total_sequence_lengths_vec
(
b
,
1
);
infinicore
::
context
::
memcpyH2D
(
input
.
total_sequence_lengths
.
value
()
->
data
(),
total_sequence_lengths_vec
.
data
(),
b
*
sizeof
(
int64_t
),
false
);
input
.
input_offsets
=
infinicore
::
Tensor
::
empty
({
b
+
1
},
infinicore
::
DataType
::
I64
,
infinicore
::
context
::
getDevice
());
std
::
vector
<
int64_t
>
input_offsets_vec
(
b
+
1
,
0
);
for
(
size_t
i
=
0
;
i
<=
b
;
i
++
)
{
input_offsets_vec
[
i
]
=
i
;
}
infinicore
::
context
::
memcpyH2D
(
input
.
input_offsets
.
value
()
->
data
(),
input_offsets_vec
.
data
(),
(
b
+
1
)
*
sizeof
(
int64_t
),
false
);
input
.
block_tables
=
block_tables_holder_
->
as_strided
({
b
,
block_per_req
},
{(
ptrdiff_t
)
block_per_req
,
1
});
input
.
slot_mapping
=
infinicore
::
Tensor
::
empty
({
b
},
infinicore
::
DataType
::
I64
,
infinicore
::
context
::
getDevice
());
infinicore
::
context
::
startGraphRecording
();
...
...
csrc/engine/compiler/static_batching_compiler.cpp
View file @
429f54cd
...
...
@@ -15,6 +15,8 @@ void StaticBatchingCompiler::compile() {
input
.
position_ids
=
infinicore
::
Tensor
::
empty
({
b
,
1
},
infinicore
::
DataType
::
I64
,
infinicore
::
context
::
getDevice
());
input
.
past_sequence_lengths
=
infinicore
::
Tensor
::
empty
({
b
},
infinicore
::
DataType
::
I64
,
infinicore
::
context
::
getDevice
());
input
.
total_sequence_lengths
=
infinicore
::
Tensor
::
empty
({
b
},
infinicore
::
DataType
::
I64
,
infinicore
::
context
::
getDevice
());
std
::
vector
<
int64_t
>
total_sequence_lengths_vec
(
b
,
1
);
infinicore
::
context
::
memcpyH2D
(
input
.
total_sequence_lengths
.
value
()
->
data
(),
total_sequence_lengths_vec
.
data
(),
b
*
sizeof
(
int64_t
),
false
);
infinicore
::
context
::
startGraphRecording
();
auto
output
=
model_
->
forward
(
input
);
auto
graph
=
infinicore
::
context
::
stopGraphRecording
();
...
...
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