-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AD model performance benchmark (#718)
This PR adds an AD model performance benchmark so that we can compare model performance across versions. We run the benchmark in separate github workflows since they can be time consuming. For example, it takes 25+ minutes to run HCAD benchmarking alone in 1.1. Also, we print bench-marking results in standard output for recording purpose. For HCAD, we randomly generated synthetic data with known anomalies inserted throughout the signal. In particular, these are one/two/four dimensional data where each dimension is a noisy cosine wave. Anomalies are inserted into one dimension with 0.003 probability. Anomalies across each dimension can be independent or dependent. We have approximately 5000 observations per data set. The data set is generated using the same random seed so the result is comparable across versions. For single stream detectors, we use a curated data set with known anomaly windows. We also backported #600 so that we can capture the performance data in CI output. Testing done: 1. added unit tests to run the benchmark. Signed-off-by: Kaituo Li <[email protected]>
- Loading branch information
Showing
11 changed files
with
957 additions
and
188 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
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,86 @@ | ||
name: Run AD benchmark | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
|
||
Build-ad: | ||
strategy: | ||
matrix: | ||
java: [14] | ||
|
||
name: Run Anomaly detection model performance benchmark | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Java ${{ matrix.java }} | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
|
||
# anomaly-detection | ||
- name: Checkout AD | ||
uses: actions/checkout@v2 | ||
|
||
# dependencies: OpenSearch | ||
- name: Checkout OpenSearch | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: 'opensearch-project/OpenSearch' | ||
path: OpenSearch | ||
ref: '1.1.0' | ||
- name: Build OpenSearch | ||
working-directory: ./OpenSearch | ||
run: ./gradlew publishToMavenLocal | ||
|
||
# dependencies: common-utils | ||
- name: Checkout common-utils | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: '1.1' | ||
repository: 'opensearch-project/common-utils' | ||
path: common-utils | ||
- name: Build common-utils | ||
working-directory: ./common-utils | ||
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT | ||
|
||
# dependencies: job-scheduler | ||
- name: Checkout job-scheduler | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: '1.1' | ||
repository: 'opensearch-project/job-scheduler' | ||
path: job-scheduler | ||
|
||
- name: Build job-scheduler | ||
working-directory: ./job-scheduler | ||
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT | ||
- name: Assemble job-scheduler | ||
working-directory: ./job-scheduler | ||
run: | | ||
./gradlew assemble -Dopensearch.version=1.1.0-SNAPSHOT | ||
echo "Creating ../src/test/resources/job-scheduler ..." | ||
mkdir -p ../src/test/resources/job-scheduler | ||
pwd | ||
echo "Copying ./build/distributions/*.zip to ../src/test/resources/job-scheduler ..." | ||
ls ./build/distributions/ | ||
cp ./build/distributions/*.zip ../src/test/resources/job-scheduler | ||
echo "Copied ./build/distributions/*.zip to ../src/test/resources/job-scheduler ..." | ||
ls ../src/test/resources/job-scheduler | ||
echo "Creating ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT ..." | ||
mkdir -p ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT | ||
echo "Copying ./build/distributions/*.zip to ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT ..." | ||
ls ./build/distributions/ | ||
cp ./build/distributions/*.zip ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT | ||
echo "Copied ./build/distributions/*.zip to ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT ..." | ||
ls ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT | ||
- name: Build and Run Tests | ||
run: | | ||
./gradlew ':test' --tests "org.opensearch.ad.ml.HCADModelPerfTests" -Dtests.seed=2AEBDBBAE75AC5E0 -Dtests.security.manager=false -Dtests.locale=es-CU -Dtests.timezone=Chile/EasterIsland -Dtest.logs=true -Dmodel-benchmark=true | ||
./gradlew integTest --tests "org.opensearch.ad.e2e.SingleStreamModelPerfIT" -Dtests.seed=60CDDB34427ACD0C -Dtests.security.manager=false -Dtests.locale=kab-DZ -Dtests.timezone=Asia/Hebron -Dtest.logs=true -Dmodel-benchmark=true |
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.