-
Notifications
You must be signed in to change notification settings - Fork 79
added template for data reader to pass conduit node from driver #2473
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
Draft
bvanessen
wants to merge
3
commits into
LBANN:v1.x-develop
Choose a base branch
from
bvanessen:lbann-core-conduit
base: v1.x-develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,5 +1,18 @@ | ||
| cmake_minimum_required(VERSION 3.18.0) | ||
| project(my_lbann_test C CXX) | ||
| cmake_minimum_required(VERSION 3.21.0) | ||
| project(my_lbann_test CXX) | ||
bvanessen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| find_package(LBANN 0.102.0 REQUIRED) | ||
| add_executable(Main main.cpp) | ||
| target_link_libraries(Main PRIVATE LBANN::lbann) | ||
| find_package(Conduit CONFIG REQUIRED) | ||
bvanessen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| add_executable(lbann-core main.cpp) | ||
| target_link_libraries(lbann-core PRIVATE LBANN::lbann) | ||
|
|
||
| #target_link_libraries(lbann-bin lbann) | ||
| set_target_properties(lbann-core | ||
| PROPERTIES | ||
| OUTPUT_NAME lbann-core-driver | ||
| RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
|
||
| #list(APPEND LBANN_EXE_TGTS lbann-core) | ||
|
|
||
| install(TARGETS lbann-core | ||
| EXPORT LBANNTargets | ||
| RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
bvanessen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or 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 hidden or 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,10 @@ | ||
| export AL_PROGRESS_RANKS_PER_NUMA_NODE=2 | ||
| export OMP_NUM_THREADS=8 | ||
| export MV2_USE_RDMA_CM=0 | ||
|
|
||
| # This should be a checkpointed lenet model | ||
| MODEL_LOC="path/to/checkpointed/model" | ||
|
|
||
| ./Main $MODEL_LOC | ||
| ./Main $MODEL_LOC --dist | ||
| ./Main $MODEL_LOC --conduit |
This file contains hidden or 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
72 changes: 72 additions & 0 deletions
72
include/lbann/data_ingestion/readers/data_reader_conduit.hpp
This file contains hidden or 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,72 @@ | ||
| //////////////////////////////////////////////////////////////////////////////// | ||
| // Copyright (c) 2014-2021, Lawrence Livermore National Security, LLC. | ||
| // Produced at the Lawrence Livermore National Laboratory. | ||
| // Written by the LBANN Research Team (B. Van Essen, et al.) listed in | ||
| // the CONTRIBUTORS file. <[email protected]> | ||
| // | ||
| // LLNL-CODE-697807. | ||
| // All rights reserved. | ||
| // | ||
| // This file is part of LBANN: Livermore Big Artificial Neural Network | ||
| // Toolkit. For details, see http://software.llnl.gov/LBANN or | ||
| // https://github.com/LLNL/LBANN. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "Licensee"); 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 LBANN_DATA_READER_CONDUIT_HPP | ||
| #define LBANN_DATA_READER_CONDUIT_HPP | ||
|
|
||
| #include "lbann/data_readers/data_reader.hpp" | ||
| #include "lbann/data_store/data_store_conduit.hpp" | ||
|
|
||
| namespace lbann { | ||
| /** | ||
| * A generalized data reader for passed in conduit nodes. | ||
| */ | ||
| class conduit_data_reader : public generic_data_reader | ||
| { | ||
| public: | ||
| conduit_data_reader* copy() const override { return new conduit_data_reader(*this); } | ||
| bool has_conduit_output() override { return true; } | ||
| void load() override; | ||
| bool fetch_conduit_node(conduit::Node& sample, int data_id) override; | ||
|
|
||
| void set_data_dims(std::vector<int> dims); | ||
| void set_label_dims(std::vector<int> dims); | ||
|
|
||
| std::string get_type() const override { return "conduit_data_reader"; } | ||
| int get_linearized_data_size() const override { | ||
| int data_size = 1; | ||
| for(int i : m_data_dims) { | ||
| data_size *= i; | ||
| } | ||
| return data_size; | ||
| } | ||
| int get_linearized_label_size() const override { | ||
| int label_size = 1; | ||
| for(int i : m_label_dims) { | ||
| label_size *= i; | ||
| } | ||
| return label_size; | ||
| } | ||
|
|
||
| protected: | ||
bvanessen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| std::vector<int> m_data_dims; | ||
| std::vector<int> m_label_dims; | ||
|
|
||
| }; // END: class conduit_data_reader | ||
|
|
||
| } // namespace lbann | ||
|
|
||
| #endif // LBANN_DATA_READER_CONDUIT_HPP | ||
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.
Uh oh!
There was an error while loading. Please reload this page.