Skip to content

Commit

Permalink
Update to marius 0.0.2 (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMoho authored Apr 11, 2022
1 parent aecfe8c commit 1928710
Show file tree
Hide file tree
Showing 659 changed files with 38,444 additions and 19,706 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Steps to reproduce the behavior:
A clear and concise description of what you expected to happen.

**Environment**
List your operating system, and dependency versions
List your operating system, and dependency versions. You can obtain this by running `marius_env_info` from the command line.

**Additional context**
Add any other context about the problem here.
150 changes: 19 additions & 131 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Build and Test

on: [push, pull_request]

on:
push:
branches:
- main
pull_request:
branches:
- main
env:
BUILD_TYPE: Release

Expand All @@ -27,143 +32,26 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Torch
working-directory: ${{github.workspace}}
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
python3 -m pip install torch==1.7.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
elif [ "$RUNNER_OS" == "macOS" ]; then
python3 -m pip install torch==1.7.1
else
echo "$RUNNER_OS not supported"
exit 1
fi
if [ "$RUNNER_OS" == "Linux" ]; then
pip3 install torch --extra-index-url https://download.pytorch.org/whl/cpu
elif [ "$RUNNER_OS" == "macOS" ]; then
pip3 install torch
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Install Python Dependencies
- name: Install Marius
working-directory: ${{github.workspace}}
shell: bash
run: python3 -m pip install -r requirements.txt

- name: Run CCache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.os }}

- name: CMake Build
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=${BUILD_TYPE} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache'
buildWithCMake: true
buildWithCMakeArgs: '-- -j 2'
buildDirectory: '${{ github.workspace }}/build'
run: pip3 install . --verbose

- name: Run C++ Tests
shell: cmake -P {0}
run: |
include(ProcessorCount)
ProcessorCount(N)
set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON")
execute_process(
COMMAND ctest -j ${N}
WORKING_DIRECTORY build
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE output
ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE
)
if (NOT result EQUAL 0)
string(REGEX MATCH "[0-9]+% tests.*[0-9.]+ sec.*$" test_results "${output}")
string(REPLACE "\n" "%0A" test_results "${test_results}")
message("::error::${test_results}")
message(FATAL_ERROR "Running tests failed!")
endif()
- name: Run Python Tests
- name: Run Tests
working-directory: ${{github.workspace}}
shell: bash
# Run python tests with tox
run: tox


packaging:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Latest GCC", artifact: "Linux.7z",
os: ubuntu-latest,
cc: "gcc", cxx: "g++"
}
- {
name: "macOS Latest Clang", artifact: "macOS.7z",
os: macos-latest,
cc: "clang", cxx: "clang++"
}
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Torch
working-directory: ${{github.workspace}}
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
python3 -m pip install torch==1.7.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
elif [ "$RUNNER_OS" == "macOS" ]; then
python3 -m pip install torch==1.7.1
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Run Pip Install
working-directory: ${{github.workspace}}
shell: bash
run: python3 -m pip install . --verbose

- name: Test Pip Install
working-directory: ${{github.workspace}}
shell: bash
run: |
python3 -c "import marius as m"
python3 -c "from marius.tools import preprocess"
marius_preprocess output_dir/ --dataset fb15k
pytest test
run: MARIUS_TEST_HOME=test/ python3 -m pytest test/python --verbose

80 changes: 0 additions & 80 deletions .github/workflows/memory_check.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CTestTestfile.cmake
.idea/
cmake-*/
logs/
test/test_data/generated/
*.dylib

# Created by https://www.toptal.com/developers/gitignore/api/python
Expand Down
9 changes: 3 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
[submodule "src/cpp/third_party/googletest"]
path = src/cpp/third_party/googletest
url = https://github.com/google/googletest.git
[submodule "src/cpp/third_party/cxxopts"]
path = src/cpp/third_party/cxxopts
url = https://github.com/jarro2783/cxxopts.git
[submodule "src/cpp/third_party/inih"]
path = src/cpp/third_party/inih
url = https://github.com/jtilly/inih.git
[submodule "src/cpp/third_party/parallel-hashmap"]
path = src/cpp/third_party/parallel-hashmap
url = https://github.com/greg7mdp/parallel-hashmap.git
Loading

0 comments on commit 1928710

Please sign in to comment.