Skip to content

Conversation

@machichima
Copy link

Purpose of PR

Improve development experience by introducing make commands to install, run tests, and do profiling.

Also move benchmark/ into qdp-python and update pyproject.toml to install dependencies needed with different --group args

Related Issues or PRs

Closes #735

Changes Made

  • Bug fix
  • New feature
  • Refactoring
  • Documentation
  • Test
  • CI/CD pipeline
  • Other

Breaking Changes

  • Yes
  • No

Checklist

  • Added or updated unit tests for all changes
  • Added or updated documentation for all changes
  • Successfully built and ran all unit tests or manual tests locally
  • PR title follows "MAHOUT-XXX: Brief Description" format (if related to an issue)
  • Code follows ASF guidelines

@machichima
Copy link
Author

cc @ryankert01

Copy link
Contributor

@ryankert01 ryankert01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestion about usage.

Comment on lines 115 to 117
make unit_test # Run all unit tests (Python + Rust)
make unit_test_python # Run Python tests only
make unit_test_rust # Run Rust tests only
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits

Suggested change
make unit_test # Run all unit tests (Python + Rust)
make unit_test_python # Run Python tests only
make unit_test_rust # Run Rust tests only
make test # Run all unit tests (Python + Rust)
make test_python # Run Python tests only
make test_rust # Run Rust tests only

Or use the make command from the `qdp/` directory:

```bash
make e2e_test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our benchmarks are not stable right now, we might use different benchmark command. so I don't think we need this in make.
eg. tryout different qubitspython e2e.py --qubits 100

Comment on lines +43 to +50
run_nvtx_profile:
$(eval EXAMPLE ?= nvtx_profile)
@echo "Building example '$(EXAMPLE)' with observability features..."
cargo build -p qdp-core --example $(EXAMPLE) --features observability --release
@echo "Running '$(EXAMPLE)' with nsys profiling..."
nsys profile --trace=cuda,nvtx --force-overwrite=true -o report ./target/release/examples/$(EXAMPLE)
@echo "Showing profiling statistics..."
nsys stats --force-export=true report.nsys-rep
Copy link
Contributor

@ryankert01 ryankert01 Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(optional) In this, we can only profile /example? Is this a big limitation?
I think it's also unnessary for make, but not sure if others think otherwise.
cc @rich7420 I'm not familiar with this. I never use /example to profile XD. I profile benchmarks directly everytime.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please show me how to profile benchmarks directly? The documentation we had profiling the example, that's why I only put example here

Copy link
Contributor

@ryankert01 ryankert01 Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use something like this, and it's because I also want to profile every parts of the code.

nsys profile python some_benchmark.py

Could you implement a make install or something that makes it profile-able?
It should be build like cargo build -p qdp-core --example $(EXAMPLE) --features observability --release as in L46 to make profile-able.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryankert01
Actually I did profile example before you told me this way.

qdp/Makefile Outdated
Comment on lines 38 to 41
e2e_test:
@echo "Running e2e benchmark tests..."
cd qdp-python/benchmark && uv run python benchmark_e2e.py
cd qdp-python/benchmark && uv run python benchmark_dataloader_throughput.py
Copy link
Contributor

@ryankert01 ryankert01 Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
e2e_test:
@echo "Running e2e benchmark tests..."
cd qdp-python/benchmark && uv run python benchmark_e2e.py
cd qdp-python/benchmark && uv run python benchmark_dataloader_throughput.py
install_benchmark:
cd qdp/qdp-python && uv sync --group benchmark
benchmark: install install_benchmark
@echo "Running e2e benchmark tests..."
uv run python qdp-python/benchmark/benchmark_e2e.py
uv run python qdp-python/benchmark/benchmark_dataloader_throughput.py

@ryankert01
Copy link
Contributor

Thanks @machichima 's contribution! I tested locally and these commands works.

@machichima
Copy link
Author

Thanks @ryankert01 for review! I updated based on your review:

  1. unit_test_... -> test_...
  2. make e2e_test -> make benchmark
  3. Add make install_profile

Copy link
Contributor

@ryankert01 ryankert01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg, please add [QDP] prefix for the pr. Thanks for your contribution.

@rich7420 rich7420 changed the title [Housekeeping] Clean structure and make commands [QDP][Housekeeping] Clean structure and make commands Dec 24, 2025
@rich7420
Copy link
Contributor

@machichima thanks for the patch

@rich7420
Copy link
Contributor

@machichima plz resolve the conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants