You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/release.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,11 @@ _to be written during release process_
20
20
-[ ] Create PR to merge from current develop into release branch
21
21
-[ ] Write Changelog in PR and request review
22
22
-[ ] Review the PR (if OK - merge, but DO NOT delete the branch)
23
-
-[ ] Minimize packages in requirements.txt and conda-forge submission. Update packages in setup.py
23
+
-[ ]On `Release` ,Minimize packages in requirements.txt and conda-forge submission. Update packages in pyproject.toml
24
24
-[ ] Check unit tests -> Check all tests pass on CPU and [GPU (e.g. on colab)](https://colab.research.google.com/drive/1lFpdtY5zV7VpW88aazedA3n4khedHDQP?usp=sharing#scrollTo=IbU2vypPQ-Ej) and that there are tests for all important features
25
25
-[ ] Check documentation -> Check presence of documentation for all features by locally building the docs on the release
26
-
-[ ] Change version number in setup.py and docs (under conf.py)
26
+
-[ ] Change version number in pyproject.toml and docs (under conf.py) and in `__init__.py`
27
+
-[ ] In `__init__.py`, set `TORCHQUAD_DISABLE_LOGGING` to `True`
27
28
-[ ] Trigger the Upload Python Package to testpypi GitHub Action (https://github.com/esa/torchquad/actions/workflows/deploy_to_test_pypi.yml) on the release branch (need to be logged in)
28
29
-[ ] Test the build on testpypi (with `pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple torchquad`)
Copy file name to clipboardExpand all lines: README.md
+99-11Lines changed: 99 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,9 +148,10 @@ import torchquad
148
148
torchquad._deployment_test()
149
149
```
150
150
151
-
After cloning the repository, developers can check the functionality of `torchquad` by running the following command in the `torchquad/tests` directory:
151
+
After cloning the repository, developers can check the functionality of `torchquad` by running
To change the logger verbosity, set the `TORCHQUAD_LOG_LEVEL` environment
196
-
variable; for example `export TORCHQUAD_LOG_LEVEL=DEBUG`.
196
+
## Logging Configuration
197
+
198
+
By default, torchquad disables its internal logging when installed from PyPI to avoid interfering with other loggers in your application. To enable logging change `TORCHQUAD_DISABLE_LOGGING` in `__init__.py`:
199
+
200
+
1.**Set the log level**: Use the `TORCHQUAD_LOG_LEVEL` environment variable:
201
+
```bash
202
+
export TORCHQUAD_LOG_LEVEL=DEBUG # For detailed debugging
203
+
export TORCHQUAD_LOG_LEVEL=INFO # For general information
204
+
export TORCHQUAD_LOG_LEVEL=WARNING # For warnings only (default when enabled)
205
+
```
206
+
207
+
2.**Enable logging programmatically**:
208
+
```python
209
+
import torchquad
210
+
torchquad.set_log_level("DEBUG") # This will enable and configure logging
211
+
```
212
+
213
+
## Multi-GPU Usage
214
+
215
+
torchquad supports multi-GPU systems through standard PyTorch practices. The recommended approach is to use the `CUDA_VISIBLE_DEVICES` environment variable to control GPU selection:
For parallel processing across multiple GPUs, we recommend spawning separate processes rather than trying to coordinate multiple GPUs within a single process. This approach:
231
+
232
+
- Provides clean separation between GPU processes
233
+
- Avoids complex device management
234
+
- Follows PyTorch best practices
235
+
- Enables easy load balancing and error handling
236
+
237
+
For detailed examples and advanced multi-GPU patterns, see the [Multi-GPU Usage section](https://torchquad.readthedocs.io/en/main/tutorial.html#multi-gpu-usage) in our documentation.
197
238
198
239
You can find all available integrators [here](https://torchquad.readthedocs.io/en/main/integration_methods.html).
199
240
@@ -206,13 +247,60 @@ See the [open issues](https://github.com/esa/torchquad/issues) for a list of pro
206
247
<!-- PERFORMANCE -->
207
248
## Performance
208
249
209
-
Using GPUs torchquad scales particularly well with integration methods that offer easy parallelization. For example, below you see error and runtime results for integrating the function `f(x,y,z) = sin(x * (y+1)²) * (z+1)` on a consumer-grade desktop PC.
250
+
Using GPUs, torchquad scales particularly well with integration methods that offer easy parallelization. The benchmarks below demonstrate performance across challenging functions from 1D to 15D, comparing torchquad's GPU-accelerated methods against scipy's CPU implementations.
*Convergence comparison across challenging test functions from 1D to 15D. GPU-accelerated torchquad methods demonstrate great performance, particularly for high-dimensional integration where scipy's nquad becomes computationally infeasible. Beyond 1D, torchquad significantly outperforms scipy in efficiency.*
*Runtime-error trade-offs across dimensions. Lower-left positions indicate better performance. While scipy's traditional methods are competitive for simple 1D problems, torchquad's GPU acceleration provides orders of magnitude better performance for multi-dimensional integration, achieving both faster computation and lower errors.*
*Cross-framework performance comparison for 1D integration using Monte Carlo and Simpson methods. Demonstrates torchquad's consistent API across PyTorch, TensorFlow, JAX, and NumPy backends, with GPU acceleration providing significant performance advantages for large number of function evaluations. All frameworks achieve similar accuracy while showcasing the computational benefits of GPU acceleration for parallel integration methods.*
272
+
273
+
### Running Benchmarks
274
+
275
+
To reproduce these benchmarks or test performance on your hardware:
276
+
277
+
```bash
278
+
# Run all benchmarks (convergence, framework comparison, scaling, vectorized)
*Runtime results of the integration. Note the far superior scaling on the GPU (solid line) in comparison to the CPU (dashed and dotted) for both methods.*
298
+
**New Features:**
299
+
-**Analytic Reference Values**: Uses SymPy for exact analytic solutions where possible, providing highly accurate reference values for error calculations
300
+
-**Enhanced Test Functions**: Analytically tractable but numerically challenging functions that better demonstrate convergence behavior
301
+
-**Framework Comparison**: Cross-backend performance benchmarking across PyTorch, TensorFlow, JAX, and NumPy with GPU/CPU device comparisons
*Convergence results of the integration. Note that Simpson quickly reaches floating point precision. Monte Carlo is not competitive here given the low dimensionality of the problem.*
303
+
**Hardware:** RTX 4060 Ti 16GB, i5-13400F, Precision: float32
216
304
217
305
<!-- CONTRIBUTING -->
218
306
## Contributing
@@ -245,12 +333,12 @@ Please note that PRs should be created from and into the `develop` branch. For e
245
333
3. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
246
334
4. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
247
335
5. Push to the Branch (`git push origin feature/AmazingFeature`)
248
-
6. Open a Pull Request on the `develop` branch, *not*`main` (NB: We autoformat every PR with black. Our GitHub actions may create additional commits on your PR for that reason.)
336
+
6. Open a Pull Request on the `develop` branch, *not*`main`
249
337
250
338
and we will have a look at your contribution as soon as we can.
251
339
252
-
Furthermore, please make sure that your PR passes all automated tests. Review will only happen after that.
253
-
Only PRs created on the `develop` branch with all tests passing will be considered. The only exception to this rule is if you want to update the documentation in relation to the current release on conda / pip. In that case you may ask to merge directly into `main`.
340
+
Furthermore, please make sure that your PR passes all automated tests, you can ping `@gomezzz` to run the CI. Review will only happen after that.
341
+
Only PRs created on the `develop` branch with all tests passing will be considered. The only exception to this rule is if you want to update the documentation in relation to the current release on conda / pip. In that case you open a PR directly into `main`.
0 commit comments