-
Notifications
You must be signed in to change notification settings - Fork 10
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
Benchmark Visualizer: Conjure Native vs Oxide #291
Open
PedroGGBM
wants to merge
13
commits into
conjure-cp:main
Choose a base branch
from
PedroGGBM:benchmark-visualizer
base: main
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.
Open
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3ba15a1
testing backframe for cpu time using instant [for all tests, attempte…
PedroGGBM 70d444f
init changes base on samvit dashboard and draft for rust subprocess s…
PedroGGBM 8b4e4bf
large commit for initial conjure native solution scraper and python d…
PedroGGBM eb3aa9b
[MIXED COMMIT] data scraping for both conjure native (based on exhaus…
PedroGGBM 531b337
[MIXED COMMIT] finalized dashboard using Dash for oxide vs native vis…
PedroGGBM bf69915
large commit for init of dashboard for conjure native vs. oxide bench…
PedroGGBM 23a5dc5
clean up of ./data directory, eliminated env (accident), and misc tasks
PedroGGBM edd864b
commented cpu_time_tests.rs testing script and added more xyz test va…
PedroGGBM a305a17
added support for static html dashboard by using Quarto for generatation
PedroGGBM 1a61cfd
Merge branch 'main' into benchmark-visualizer
PedroGGBM 7e11b86
[FIX] removed dynamic dashboard, removed several exhaustive test of o…
PedroGGBM 1d67c82
[FIX & NEW] Added grouped bars for native vs oxide Minion solver comp…
PedroGGBM 87628d7
Merge branch 'main' into benchmark-visualizer
niklasdewally File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,52 @@ | ||
// // cpu_time_tests.rs | ||
// // @author Pedro Gronda Garrigues | ||
|
||
// use serde::{Deserialize, Serialize}; | ||
// use std::collections::HashMap; | ||
// use std::time::{Duration, Instant}; | ||
|
||
// // struct for CPU time data | ||
// #[derive(Serialize, Deserialize, Debug)] | ||
// struct TestCPUTime { | ||
// name: String, | ||
// cpu_time: Duration, | ||
// } | ||
|
||
// // function to run test & measure CPU time | ||
// fn run_test_cpu_time<F: FnOnce()>(name: &str, test_fn: F) -> TestCPUTime { | ||
// let start_time = Instant::now(); | ||
// test_fn(); | ||
// let end_time = Instant::now(); | ||
// let cpu_time = end_time - start_time; | ||
// TestCPUTime { | ||
// name: name.to_string(), | ||
// cpu_time, | ||
// } | ||
// } | ||
|
||
// // function to write CPU tiem data to file | ||
// fn write_cpu_time_data(data: HashMap<String, Vec<TestCPUTime>) -> Result<(), Box<dyn std::error::Error>> { | ||
// let file = std::fs::File::create("cpu_time_data.json")?; | ||
// serde_json::to_writer(file, &data)?; | ||
// Ok(()) | ||
// } | ||
|
||
// fn write_tests() { | ||
// // assume import of tests (Work in Progress...) | ||
// // | ||
|
||
// let mut cpu_time_data: HashMap<String, Vec<TestCPUTime>> = HashMap::new(); | ||
// let tests = vec![ | ||
// // format: ("name", tests::test_<...>) | ||
// ]; | ||
|
||
// for (name, test_fn) in tests { | ||
// let test_cpu_time = run_test_cpu_time(name, test_fn); | ||
// let category = "Testing".to_string(); // assume test category (to be changed) | ||
// cpu_time_data.entry(name).or_insert_with(Vec::new).push(test_cpu_time); | ||
// } | ||
|
||
// if let Err(err) = write_cpu_time_data(cpu_time_data) { | ||
// eprintln!("Error writing CPU time data: {}", err); | ||
// } | ||
// } |
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,13 @@ | ||
[package] | ||
name = "benchmarks-visualizer" | ||
version = "0.1.0" | ||
authors = ["Pedro Gronda Garrigues"] | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
rayon = "1.5.1" # for conjure native test parallelization | ||
|
||
[lints] | ||
workspace = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# BENCHMARKS VISUALIZER | ||
|
||
A dashboard to visualize useful statistics comparing Conjure (native) and Conjure Oxide | ||
|
||
Stats included thus far: | ||
- Num of Nodes (incomplete, need comparison between node count for native vs oxide) | ||
- Time elapsed (milliseconds, ms) | ||
|
||
Author: Pedro Gronda Garrigues (220027583) | ||
|
||
## DEPENDENCIES | ||
|
||
To download requirement dependencies, follow the folling steps. | ||
|
||
*Note: this is done manually instead of in build.sh for safety reasons. | ||
|
||
1. Make sure you are in the correct repo directory | ||
```bash | ||
cd ./tools/benchmarks-visualizer | ||
``` | ||
|
||
2. Create virtual environment | ||
```bash | ||
python -m venv env | ||
``` | ||
|
||
3. Activate virtual environment | ||
```bash | ||
# for Windows 10/11 | ||
.\env\Scripts\activate | ||
|
||
# for macOS/Linux | ||
source env/bin/activate | ||
``` | ||
|
||
4. Install required packages | ||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
## EXECUTE | ||
|
||
A shell script is provided, which includes a prompted option to rerun all exhaustive tests for both Conjure and Conjure Oxide: | ||
```bash | ||
./build.sh | ||
``` | ||
|
||
## UPDATE MANUALLY | ||
|
||
To update conjure native solver solutions statistics and oxide statistics, please execute the following (already included in build.sh): | ||
```bash | ||
# ensure you are in ./tools/benchmarks-visualizer directory | ||
cd ./tools/benchmarks-visualizer | ||
|
||
# to write data to ./data for conjure native for solver(s) | ||
CARGO_TARGET_DIR=./tools/benchmarks-visualizer cargo build --bin conjure_native_benchmarks | ||
./tools/benchmarks-visualizer/debug/conjure_native_benchmarks | ||
|
||
# to write data to ./data for conjure oxide (Minion supported for now) -- warning: very verbose | ||
./src/conjure_oxide_benchmarks.sh | ||
``` | ||
|
||
## RUN DASHBOARD MANUALLY | ||
|
||
To run Dash dashboard manually simply execute the app.py script: | ||
```bash | ||
python3 src/app.py | ||
``` | ||
|
||
To then visualize the dashboard (for now, until hosted), open a web browser and navigate to `http://127.0.0.1:8050/`: | ||
```bash | ||
# for windows 10/11 | ||
start http://127.0.0.1:8050/ | ||
|
||
# for macOS | ||
open http://127.0.0.1:8050/ | ||
|
||
# for Linux (most desktop env) | ||
xdg-open http://127.0.0.1:8050/ | ||
``` |
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,38 @@ | ||
#!/bin/bash | ||
# @author: Pedro Gronda Garrigues | ||
|
||
# prompt for updating Conjure Native data | ||
read -p "Do you want to update Conjure Native exhaustive test data? (yes/no) " update_native | ||
if [[ $update_native == "yes" ]]; then | ||
# build and run conjure_native_benchmarks | ||
echo "Building Conjure Native benchmarks..." | ||
CARGO_TARGET_DIR=./tools/benchmarks-visualizer cargo build --bin conjure_native_benchmarks | ||
|
||
if [[ $? -eq 0 ]]; then | ||
echo "STATUS: Running Conjure Native exhaustive tests..." | ||
./tools/benchmarks-visualizer/debug/conjure_native_benchmarks | ||
else | ||
echo "STATUS: Build failed for Conjure Native benchmarks." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
# prompt for updating Conjure Oxide data | ||
read -p "Do you want to update Conjure Oxide data? (yes/no) " update_oxide | ||
if [[ $update_oxide == "yes" ]]; then | ||
# run conjure_oxide_benchmarks.sh script | ||
echo "STATUS: Running Conjure Oxide benchmarks..." | ||
./src/conjure_oxide_benchmarks.sh | ||
fi | ||
|
||
# execute the Python script for visualization dashboard | ||
echo "STATUS: Running the Python visualization app..." | ||
python3 ./src/app.py | ||
|
||
# check for any errors in Python script execution | ||
if [[ $? -ne 0 ]]; then | ||
echo "STATUS: Error occurred while running the Python visualization app." | ||
exit 2 | ||
fi | ||
|
||
echo "STATUS: Benchmark visualization process completed successfully." |
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 @@ | ||
dash | ||
plotly | ||
dash-bootstrap-components | ||
pandas |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file entirely commented out. should it be here?