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
infinicore
Commits
807e5e43
Commit
807e5e43
authored
Jan 27, 2026
by
PanZezhong
Browse files
issue/811 use relax graph capture mode, add compile flag for graph instantiate
parent
1fa56298
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
src/infinicore/graph/graph.cc
src/infinicore/graph/graph.cc
+3
-1
src/infinicore/tensor/view.cc
src/infinicore/tensor/view.cc
+4
-2
xmake.lua
xmake.lua
+12
-0
No files found.
src/infinicore/graph/graph.cc
View file @
807e5e43
...
...
@@ -84,7 +84,7 @@ void Graph::instantiate() {
if
(
infinirtStreamBeginCapture
(
context
::
getStream
(),
INFINIRT_STREAM_CAPTURE_MODE_
GLOBAL
)
INFINIRT_STREAM_CAPTURE_MODE_
RELAXED
)
!=
INFINI_STATUS_SUCCESS
)
{
return
;
}
...
...
@@ -144,7 +144,9 @@ std::shared_ptr<Graph> GraphManager::stop_recording() {
return
nullptr
;
}
recording_
=
false
;
#ifdef USE_INFINIRT_GRAPH
graph_
->
instantiate
();
#endif
return
std
::
exchange
(
graph_
,
nullptr
);
}
...
...
src/infinicore/tensor/view.cc
View file @
807e5e43
...
...
@@ -2,6 +2,8 @@
#include "infinicore/dtype.hpp"
#include "infinicore/tensor.hpp"
#include "../utils.hpp"
#include <spdlog/spdlog.h>
#include <stdexcept>
...
...
@@ -62,11 +64,11 @@ Tensor TensorImpl::narrow(const std::vector<TensorSliceParams> &slices) const {
Tensor
TensorImpl
::
permute
(
const
Shape
&
order
)
const
{
// Validate input
assert
(
meta_
.
shape
.
size
()
==
order
.
size
());
INFINICORE_ASSERT
(
meta_
.
shape
.
size
()
==
order
.
size
());
// Check that order contains all indices from 0 to n-1 exactly once
for
(
size_t
i
=
0
;
i
<
order
.
size
();
i
++
)
{
assert
(
std
::
find
(
order
.
begin
(),
order
.
end
(),
i
)
!=
order
.
end
());
INFINICORE_ASSERT
(
std
::
find
(
order
.
begin
(),
order
.
end
(),
i
)
!=
order
.
end
());
}
// Permute shape and strides
...
...
xmake.lua
View file @
807e5e43
...
...
@@ -205,6 +205,18 @@ if has_config("ninetoothed") then
add_defines
(
"ENABLE_NINETOOTHED"
)
end
-- cuda graph
option
(
"graph"
)
set_default
(
false
)
set_showmenu
(
true
)
set_description
(
"Whether to use device graph instantiating feature, such as cuda graph for nvidia"
)
option_end
()
if
has_config
(
"graph"
)
then
add_defines
(
"USE_INFINIRT_GRAPH"
)
end
-- InfiniCCL
option
(
"ccl"
)
set_default
(
false
)
...
...
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