Skip to content

Commit

Permalink
Merge pull request #14 from owkin/release_1
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-francoisreboud authored Oct 28, 2022
2 parents cd5be99 + 7997105 commit f1cb783
Show file tree
Hide file tree
Showing 158 changed files with 34,167 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Tests/MAExamples/Base/data/**/* filter=lfs diff=lfs merge=lfs -text
43 changes: 43 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: examples

on:
workflow_dispatch:
push:
branches:
- main
- release**

jobs:
MAExamples:
runs-on: self-hosted
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Pull lfs
run: git lfs pull

- name: Setup Conda Environment
run: |
conda create --name maexamples-ci python=3.7
conda env list
- name: Install Python Library
working-directory: Tests/MAExamples/Base
run: |
conda activate maexamples-ci
pip="$(dirname `which python`)"/pip
$pip install -e .
- name: Test
run: |
conda activate maexamples-ci
swift test -c release --filter MAExamples
- name: Remove Conda Environment
if: always()
run: conda env remove --name maexamples-ci
39 changes: 39 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: integration-tests

on:
workflow_dispatch:
push:
branches:
- main
- release**

jobs:
MATorchTests:
runs-on: self-hosted
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3

- name: Setup Conda Environment
run: |
conda create --name matorch-ci python=3.7
conda env list
- name: Install Python Library
working-directory: Tests/MATorchTests/Base
run: |
conda activate matorch-ci
pip="$(dirname `which python`)"/pip
$pip install -e .
- name: Test
run: |
conda activate matorch-ci
swift test --filter MATorchTests
- name: Remove Conda Environment
if: always()
run: conda env remove --name matorch-ci
17 changes: 17 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: unit-tests

on: [push]

jobs:
MAKitTests:
runs-on: self-hosted

steps:
- uses: swift-actions/setup-swift@v1
with:
swift-version: "5.7.0"
- uses: actions/checkout@v3
- name: Build
run: swift build
- name: Test
run: swift test --filter MAKitTests
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/*
.netrc

.idea/
*.egg-info/
__pycache__/

178 changes: 178 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/MAKit.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MAKit_MAKit"
BuildableName = "MAKit_MAKit"
BlueprintName = "MAKit_MAKit"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MAKit"
BuildableName = "MAKit"
BlueprintName = "MAKit"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MAKitTests"
BuildableName = "MAKitTests"
BlueprintName = "MAKitTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MATestsUtils"
BuildableName = "MATestsUtils"
BlueprintName = "MATestsUtils"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MAKit_MAExamples"
BuildableName = "MAKit_MAExamples"
BlueprintName = "MAKit_MAExamples"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MAKit_MATorchTests"
BuildableName = "MAKit_MATorchTests"
BlueprintName = "MAKit_MATorchTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES"
onlyGenerateCoverageForSpecifiedTargets = "YES">
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MAKit"
BuildableName = "MAKit"
BlueprintName = "MAKit"
ReferencedContainer = "container:">
</BuildableReference>
</CodeCoverageTargets>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MAKitTests"
BuildableName = "MAKitTests"
BlueprintName = "MAKitTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MAExamples"
BuildableName = "MAExamples"
BlueprintName = "MAExamples"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MATorchTests"
BuildableName = "MATorchTests"
BlueprintName = "MATorchTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MAKit_MAKit"
BuildableName = "MAKit_MAKit"
BlueprintName = "MAKit_MAKit"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
8 changes: 8 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Below is a list of people and organizations that have contributed
# to the MAKit project. Names should be added to the list like so:
#
# Name/Organization <email address>
#

Jean-François Reboud <[email protected]>
12 changes: 12 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Below is a list of MAKit code owners.
# They are responsible for:
#
# - reviewing PR before it can be merged into the main branch
# - handle GitHub Issues lifecycle
#
# Code owneers are added by existing code owners,
# everybody can suggeset new code owners.
#

* @jean-francoisreboud
9 changes: 9 additions & 0 deletions Docs/Architecture/ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 👷 Architecture

Here are the different components of MAKit:

- [MAKit](MAKit.md)
- [MATestsUtils](MATestsUtils.md)
- [MAKitTests](MAKitTests.md)
- [MATorchTests](MATorchTests.md)
- [MAExamples](MAExamples.md)
5 changes: 5 additions & 0 deletions Docs/Architecture/MAExamples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 👷 MAExamples

`MAExamples` contains examples that show how to interact with `MAKit`.

See the [examples](../Examples/EXAMPLES.md) documentation for more details.
6 changes: 6 additions & 0 deletions Docs/Architecture/MAKit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 👷 MAKit

`MAKit` contains the different API needed to train models and interact
with them.

See the [main concepts](../Concepts/CONCEPTS.md) to know more about `MAKit`.
37 changes: 37 additions & 0 deletions Docs/Architecture/MAKitTests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 👷 MAKitTests

`MAKitTests` contains unit tests of `MAKit`.

Some of them are systematic and repeated over many different setups to ensure
that every layer, optimizer, activation function ... is tested.

## Systematic Tests

- gradient checking tests: compare gradients of weights
computed through `backward` to an estimation computed through `forwardGC`

- flow tests: compare gradients computed in CPU and GPU

- reset tests: compare gradients computed in CPU and GPU after a reset

- reverse tests: compare gradients computed in CPU and GPU after exchanging
the execution context
(the model CPU will be executed on the GPU and vice versa)

- inference tests: compare loss in CPU and GPU during the inference phase

- load tests: compare loss in CPU and GPU after loading models from the disk

- transform tests: compare loss in CPU and GPU after applying transforms on
the model

- norm tests: test that we can clip the gradients of weights

## Other Tests

Other tests are not repeated over many different setups.
They concern some specific components:

- `MetalKernelTests`: ensure that every Metal kernel builds correctly
- `OptimizerVariablesTests`: test scheduler for optimizers and variables
- `UpdateManagementTests`: test we can control the training flow
5 changes: 5 additions & 0 deletions Docs/Architecture/MATestsUtils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 👷 MATestsUtils

`MATestsUtils` contains utils to enable the testing of plugins of `MAKit`.

To know more about plugins, see [this documentation](../Concepts/PLUGIN.md).
Loading

0 comments on commit f1cb783

Please sign in to comment.