-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
368 changed files
with
15,598 additions
and
2,148 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Scallop Core | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build-and-test: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
toolchain: | ||
- nightly | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} | ||
- run: cargo test --verbose --workspace --release |
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,60 @@ | ||
name: Scallopy with torch-tensor feature | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
SCALLOPDIR: ${{ github.workspace }} | ||
LD_LIBRARY_PATH: "/opt/intel/oneapi/mkl/latest/lib/intel64:${{ github.env.LD_LIBRARY_PATH }}" | ||
|
||
jobs: | ||
build-and-test: | ||
name: Build and Test | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
rust: [nightly] | ||
python: ["3.10"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Add conda to system path | ||
run: echo $CONDA/bin >> $GITHUB_PATH | ||
|
||
- name: Install PyTorch | ||
run: conda install pytorch::pytorch=2.0.0 -c pytorch | ||
|
||
- name: Install other dependencies | ||
run: conda install maturin tqdm | ||
|
||
- name: Install MKL | ||
run: | | ||
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | ||
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | ||
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | ||
sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | ||
sudo apt-get update | ||
sudo apt-get install -y intel-oneapi-mkl | ||
python3 -m pip install mkl | ||
ls /opt/intel/oneapi/mkl/latest/lib/intel64 # Investigating whether the library is successfully installed | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
|
||
- name: Install scallopy with torch tensor features | ||
run: make install-scallopy-torch | ||
|
||
- name: Test | ||
run: python3 etc/scallopy/tests/test.py |
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,46 @@ | ||
name: Scallopy | ||
|
||
on: [push] | ||
|
||
env: | ||
SCALLOPDIR: ${{ github.workspace }} | ||
|
||
jobs: | ||
build-and-test: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 5 | ||
matrix: | ||
python-version: | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Add conda to system path | ||
run: echo $CONDA/bin >> $GITHUB_PATH | ||
|
||
- name: Install PyTorch | ||
run: conda install pytorch::pytorch torchvision torchaudio -c pytorch | ||
|
||
- name: Install other dependencies | ||
run: conda install maturin tqdm | ||
|
||
- name: Setup rustup toolchain | ||
run: | | ||
rustup update nightly | ||
rustup default nightly | ||
- name: Install scallopy | ||
run: make install-scallopy | ||
|
||
- name: Test | ||
run: python3 etc/scallopy/tests/test.py |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# Rust and compilation | ||
target | ||
/.tmp | ||
/Cargo.lock | ||
|
||
# MacOS | ||
|
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Ziyang Li | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "scallop-core" | ||
version = "0.1.9" | ||
version = "0.2.0" | ||
authors = ["Ziyang Li <[email protected]>"] | ||
edition = "2018" | ||
|
||
|
@@ -21,10 +21,17 @@ colored = "2.0" | |
petgraph = "0.6" | ||
csv = "1.1" | ||
sprs = "0.11" | ||
chrono = "0.4" | ||
chrono = { version = "0.4", features = ["serde"] } | ||
dateparser = "0.1.6" | ||
parse_duration = "2.1.1" | ||
dyn-clone = "1.0.10" | ||
lazy_static = "1.4" | ||
serde = { version = "1.0", features = ["derive"] } | ||
rand = { version = "0.8", features = ["std_rng", "small_rng", "alloc"] } | ||
sdd = { path = "../lib/sdd" } | ||
|
||
# Optional ones | ||
tch = { version = "0.13.0", optional = true } | ||
|
||
[features] | ||
torch-tensor = ["dep:tch"] |
Empty file.
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,3 @@ | ||
0,1 | ||
1,2 | ||
2,3 |
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,3 @@ | ||
0 1 | ||
1 2 | ||
2 3 |
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,4 @@ | ||
from to | ||
0 1 | ||
1 2 | ||
2 3 |
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,4 @@ | ||
from,to | ||
0,1 | ||
1,2 | ||
2,3 |
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,3 @@ | ||
0.01,0,1 | ||
0.50,1,2 | ||
0.91,2,3 |
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,4 @@ | ||
student_id,course_id,semester,year,grade | ||
1,cse100,fa,2020,a | ||
1,cse102,sp,2021,a | ||
2,cse100,sp,2020,b |
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,3 @@ | ||
id,name,year,gender | ||
1,alice,2022,female | ||
2,bob,2023,male |
Empty file.
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,11 @@ | ||
use std::collections::hash_map::DefaultHasher; | ||
use std::hash::{Hash, Hasher}; | ||
|
||
pub fn encode_entity<V: Hash, I: Iterator<Item = V>>(functor: &str, args: I) -> u64 { | ||
let mut s = DefaultHasher::new(); | ||
functor.hash(&mut s); | ||
for arg in args { | ||
arg.hash(&mut s); | ||
} | ||
s.finish() | ||
} |
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.