-
Notifications
You must be signed in to change notification settings - Fork 691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[serving] dev graph run #7008
Merged
Merged
[serving] dev graph run #7008
Changes from all commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
a17fa00
add cmake changes for liboneflow_cpp.so
daquexian 8cedfaf
add separate target for cpp api test
daquexian 9911af2
Merge branch 'master' into liboneflow_cpp
daquexian 9f9378b
add cpp api test in ci
daquexian c4db1ad
graph run
zzk0 788a774
Merge branch 'master' into liboneflow_cpp
daquexian 9f4da59
Merge branch 'master' into liboneflow_cpp
oneflow-ci-bot 4298d3b
reverse the order of cudnn and cuda library
daquexian 9dce5ce
update logic of BUILD_MONOLITHIC_LIBONEFLOW
daquexian 56152a2
rename BUILD_MONOLITHIC_LIBONEFLOW to BUILD_MONOLITHIC_LIBONEFLOW_CPP_SO
daquexian bf1c340
refine
zzk0 91ebd5f
[draft] implement graph parameter load and save (#7010)
daquexian 86004c6
pimpl
zzk0 8c9b663
Merge branch 'master' into liboneflow_cpp
daquexian 0d12c3e
Merge branch 'master' into liboneflow_cpp
oneflow-ci-bot 63d5f72
batching
zzk0 c6d27d5
share lib directory in test container
daquexian 5089f4c
Merge branch 'liboneflow_cpp' of github.com:Oneflow-Inc/oneflow into …
daquexian 89e8952
fix typo;
zzk0 2d611f1
merge master
zzk0 7d9aef6
add github actions debug
daquexian 18b9057
Merge branch 'master' into liboneflow_cpp
daquexian 5c118a8
Revert "add github actions debug"
daquexian be2a540
Merge branch 'liboneflow_cpp' of github.com:Oneflow-Inc/oneflow into …
daquexian a0227da
add upterm debug after exe test
daquexian c6e27bc
Merge branch 'master' into liboneflow_cpp
daquexian 375fe97
sleep after fail
daquexian 2e18280
Merge branch 'liboneflow_cpp' of github.com:Oneflow-Inc/oneflow into …
daquexian 31629d7
set LD_LIBRARY_PATH in yml for cpp api test exe
daquexian 1ad7793
Merge remote-tracking branch 'origin/master' into liboneflow_cpp
daquexian f8e05da
refine
zzk0 914dbf0
Merge branch 'master' into dev_graph_api_new
zzk0 187e47f
add test file && input order
zzk0 ebd7bca
sleep
daquexian 55706b6
Merge remote-tracking branch 'origin/master' into liboneflow_cpp
daquexian 504241a
upload liboneflow_cpp.so
daquexian 7883995
modify cmake to trigger compilation
daquexian c2034db
Merge branch 'liboneflow_cpp' of https://github.com/Oneflow-Inc/onefl…
zzk0 525fbb2
load job from ir && clean && add mlir model
zzk0 2d91e01
[remove useless python code]save to .pb
zzk0 68dc409
add target of_common_obj to remove duplicate REGISTER_PASS && run of…
zzk0 5eb7cbb
Merge branch 'master' into dev_graph_api_new
zzk0 84d980a
remove openvino
zzk0 e297aeb
remove openvino test
zzk0 0895d7f
refine
zzk0 032b672
IValue
zzk0 b086f7c
Update oneflow/api/cpp/framework/graph.h
zzk0 e3df599
refine
zzk0 09f776c
Merge branch 'dev_graph_api_new' of https://github.com/Oneflow-Inc/on…
zzk0 03c98df
refine
zzk0 a789d1c
refine
zzk0 60193e0
refine
zzk0 8f83592
refine
zzk0 a61c521
refine
zzk0 25d7f18
rename in oneflow.cmake
zzk0 0a65215
refine oneflow.cmake
zzk0 fb14d66
Merge branch 'master' into dev_graph_api_new
oneflow-ci-bot 04adb1c
make of_api_common object library
zzk0 03f1344
Merge branch 'dev_graph_api_new' of https://github.com/Oneflow-Inc/on…
zzk0 968d98d
Merge branch 'master' into dev_graph_api_new
oneflow-ci-bot b50aa7c
move device util function in api to core
zzk0 28d7385
Merge branch 'master' into dev_graph_api_new
oneflow-ci-bot 9ba25f4
remove device check in New and ThreadLocalGetOrNew
zzk0 d246370
Merge branch 'dev_graph_api_new' of https://github.com/Oneflow-Inc/on…
zzk0 0a31670
Merge remote-tracking branch 'upstream/master' into dev_graph_api_new
mosout 809e578
refine
mosout 946d462
Merge remote-tracking branch 'upstream/master' into dev_graph_api_new
mosout 770b1de
fix device test
mosout 059a7c0
refine graph test
mosout a4eb3cb
Merge remote-tracking branch 'upstream/master' into dev_graph_api_new
mosout 85d9608
refine GetExeDir()
mosout c1bae17
refine GetExeDir() again
mosout a40c08a
Merge remote-tracking branch 'upstream/master' into dev_graph_api_new
mosout 7e69110
fix
mosout 422b1e2
Merge remote-tracking branch 'upstream/master' into dev_graph_api_new
mosout ca56a17
refine
mosout ae2f7ac
fix
mosout 567442d
Merge branch 'master' into dev_graph_api_new
mosout 03f5fad
Merge remote-tracking branch 'upstream/dev_graph_api_new' into dev_gr…
mosout cbf506c
add WITH_CUDA guard
daquexian 0e982a9
Merge branch 'master' into dev_graph_api_new
daquexian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
Copyright 2020 The OneFlow Authors. All rights reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#ifndef ONEFLOW_API_COMMON_JOB_BUILD_AND_INFER_CTX_H_ | ||
#define ONEFLOW_API_COMMON_JOB_BUILD_AND_INFER_CTX_H_ | ||
|
||
#include "oneflow/core/job/job.pb.h" | ||
#include "oneflow/core/job/job_build_and_infer_ctx_mgr.h" | ||
|
||
namespace oneflow { | ||
|
||
inline Maybe<Job> GetCurrentJob() { | ||
auto* job_ctx_mgr = Global<LazyJobBuildAndInferCtxMgr>::Get(); | ||
CHECK_NOTNULL_OR_RETURN(job_ctx_mgr); | ||
auto* job_ctx = | ||
JUST(job_ctx_mgr->FindJobBuildAndInferCtx(*JUST(job_ctx_mgr->GetCurrentJobName()))); | ||
CHECK_NOTNULL_OR_RETURN(job_ctx); | ||
return job_ctx->job(); | ||
} | ||
|
||
} // namespace oneflow | ||
|
||
#endif // ONEFLOW_API_COMMON_JOB_BUILD_AND_INFER_CTX_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
Copyright 2020 The OneFlow Authors. All rights reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#ifndef ONEFLOW_API_COMMON_SCOPE_H_ | ||
#define ONEFLOW_API_COMMON_SCOPE_H_ | ||
|
||
#include <memory> | ||
#include <string> | ||
#include "oneflow/core/common/just.h" | ||
#include "oneflow/core/framework/device.h" | ||
#include "oneflow/core/framework/instructions_builder.h" | ||
#include "oneflow/core/framework/session_util.h" | ||
#include "oneflow/core/job/job_conf.cfg.h" | ||
#include "oneflow/core/job/job_conf.pb.h" | ||
#include "oneflow/core/job/scope.h" | ||
|
||
namespace oneflow { | ||
|
||
inline Maybe<Scope> MakeScope(const JobConfigProto& config_proto, const Device& device) { | ||
std::shared_ptr<Scope> scope; | ||
std::shared_ptr<cfg::JobConfigProto> cfg_config_proto = | ||
std::make_shared<cfg::JobConfigProto>(config_proto); | ||
JUST(LogicalRun([&](InstructionsBuilder* builder) -> Maybe<void> { | ||
int64_t session_id = 0; | ||
std::string device_tag = "cpu"; | ||
std::string machine_ids = "0"; | ||
std::string device_ids = "0"; | ||
if (device.type() == "cuda") { | ||
device_tag = "gpu"; | ||
device_ids = std::to_string(device.device_id()); | ||
} | ||
scope = JUST(builder->BuildInitialScope(session_id, cfg_config_proto, device_tag, | ||
{machine_ids + ":" + device_ids}, nullptr, false)); | ||
return Maybe<void>::Ok(); | ||
})); | ||
return scope; | ||
} | ||
|
||
} // namespace oneflow | ||
|
||
#endif // ONEFLOW_API_COMMON_SCOPE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为什么改成只跑cpu的,cuda的也要跑吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,cuda 也要跑才对。这个地方应该是 peihong 改的,我问问。