diffct 2.5.3__tar.gz → 2.5.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {diffct-2.5.3 → diffct-2.5.4}/CHANGELOG.md +48 -0
- {diffct-2.5.3 → diffct-2.5.4}/CITATION.cff +2 -2
- {diffct-2.5.3 → diffct-2.5.4}/PKG-INFO +3 -2
- {diffct-2.5.3 → diffct-2.5.4}/README.md +2 -1
- {diffct-2.5.3 → diffct-2.5.4}/diffct/__init__.py +1 -1
- {diffct-2.5.3 → diffct-2.5.4}/diffct/_solver_state.py +2 -1
- {diffct-2.5.3 → diffct-2.5.4}/diffct/analytical_execution.py +2 -2
- {diffct-2.5.3 → diffct-2.5.4}/diffct/backends.py +2 -2
- {diffct-2.5.3 → diffct-2.5.4}/diffct/distribution.py +21 -5
- {diffct-2.5.3 → diffct-2.5.4}/diffct/operators.py +21 -20
- {diffct-2.5.3 → diffct-2.5.4}/diffct/solvers.py +27 -15
- diffct-2.5.4/docs/search/tests/item10-index-retry.spec.mjs +333 -0
- {diffct-2.5.3 → diffct-2.5.4}/examples/_block_cgls.py +60 -11
- {diffct-2.5.3 → diffct-2.5.4}/pyproject.toml +1 -1
- diffct-2.5.4/tests/test_audit_admission_failures.py +515 -0
- diffct-2.5.4/tests/test_audit_default_device.py +69 -0
- diffct-2.5.4/tests/test_audit_example_resume_binding.py +401 -0
- diffct-2.5.4/tests/test_audit_solver_callback_order.py +520 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_block_cgls.py +28 -3
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_reconstruction_work_reuse.py +15 -7
- {diffct-2.5.3 → diffct-2.5.4}/.gitignore +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/LICENSE +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/NOTICE +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/_solver_tv.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/analytical.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/chunking.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/clinical.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/constants.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/differentiable.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/geometry.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/kernels/__init__.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/kernels/analytical_transpose.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/kernels/cone_beam.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/kernels/fan_beam.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/kernels/geometry_vjp.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/kernels/parallel3d_beam.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/kernels/parallel_beam.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/kernels/spacing.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/kernels/surface_geometry.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/mayo.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/pipeline.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/projectors.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/reconstruction.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/storage.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/streaming.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/surface_gradients.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/surfaces.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/diffct/utils.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/assets/gallery/NOTICE +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/.gitignore +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/fixtures/make_tiny_model.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/fixtures/runtime-cancel/search.html +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/fixtures/tiny-model/config.json +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/fixtures/tiny-model/onnx/model_quantized.onnx +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/fixtures/tiny-model/onnx/model_quantized.onnx_data +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/fixtures/tiny-model/tokenizer.json +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/fixtures/tiny-model/tokenizer_config.json +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/full-model.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/harness.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/item1-ordering.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/item2-single-load.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/item3-cancel.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/item4-leaks.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/item5-errors.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/item6-a11y.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/item7-security.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/item8-failures.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/item9-toggle-cache.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/playwright.config.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/runtime-cancel.config.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/runtime-cancel.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/semantic-opt-in.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/site-pages.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/search/tests/worker-lifecycle.spec.mjs +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/docs/video/README.md +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/examples/README.md +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/examples/_common.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/examples/data/NOTICE +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/examples/data/preprocess_walnut.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/examples/walnut_reconstruction.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/formal/README.md +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/formal/tla/README.md +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/pytest.ini +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/__init__.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/_multiprocessing.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/_native_per_axis_spacing.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/_numba_cuda.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/_phantoms.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/benchmarks/README.md +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/benchmarks/__init__.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/benchmarks/_common.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/benchmarks/test_bench_cone.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/benchmarks/test_bench_fan.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/benchmarks/test_bench_parallel.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/distributed_projector_check.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/fixtures/native_scalar_spacing_main.npz +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_adjoint_inner_product.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_allocator_capacity.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_analytical_autograd.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_analytical_distribution.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_analytical_input_alias.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_analytical_input_alias_bfloat16.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_analytical_regressions.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_analytical_weight_distribution.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_angular_low_precision.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_axis_aligned_chords.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_batch_execution_edges.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_batched_surfaces.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_block_storage.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_call_trajectory.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_cgls_guard_exact_local.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_cgls_readonly_callback.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_cgls_state_admission.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_checkpoint_metadata_validation.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_chunked_projector.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_clinical.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_completed_transfer_reuse.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_cone_backprojection_transpose.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_cone_projector_autograd.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_cpu_install.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_cuda_exit_deallocations.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_cuda_sink_lifetimes.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_cuda_smoke.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_detector_surface_dtypes.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_detector_surface_mapping.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_detector_surface_units.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_detector_surfaces.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_distributed_numeric_failure.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_distributed_numeric_failure_native.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_distributed_training_transforms.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_example_psnr.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_execution_buffers.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_execution_features.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_execution_schedules.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_execution_state_ownership.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_execution_state_ownership_gpu.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_fbp_fan_accuracy.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_fbp_fan_offsets.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_fbp_parallel_accuracy.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_fdk_cone_accuracy.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_fdk_cone_offsets.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_geometry_autograd.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_geometry_conversions.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_geometry_gradients.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_geometry_input_validation.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_gpu_performance_contracts.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_gradcheck.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_lazy_native_observers.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_live_trajectory_validation.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_mapped_solver_io_and_checkpoint.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_mayo.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_mps_backend.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_multi_gpu_exit.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_multiprocessing.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_native_endpoint_precision.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_native_per_axis_admission.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_native_per_axis_extremes.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_native_per_axis_helical.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_native_per_axis_spacing.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_native_per_axis_spacing_gpu.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_native_stream_cache_threads.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_native_surface_transforms.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_native_volume_layout.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_native_volume_layout_distributed.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_output_pipeline_overlap.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_parallel3d.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_parallel3d_native.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_parallel3d_native_distributed.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_parallel3d_surface_oracle.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_partition_lifecycle.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_plan_memory_bounds.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_accuracy.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_bounded_autograd.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_cuda_budget.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_distributed_geometry.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_endpoint_precision.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_execution_bounds.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_into_default_dtype.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_into_snapshots.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_into_state_edges.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_into_work_plan.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_numeric_regressions.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_sampler_snapshot.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_portable_surface_admission.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_pr42_review_regressions.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_projector_api.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_projector_degenerate_geometry.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_projector_geometry_devices.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_projector_thread_safety.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_ramp_filter_windows.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_reconstruction_api.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_reference_backend.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_release_2_0_1.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_review_230.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_review_regressions.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_runtime_store_failures.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_solver_admission_regressions.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_solver_api.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_solver_checkpoint_edges.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_solver_collective_failures.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_solver_device_scalars.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_spatial_partition.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_store_runtime_contract.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_collective_failures.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_composition_kernel.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_compute_shards.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_geometry_cudasim.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_gpu_execution.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_gradient_replay.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_host_sampling_budget.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_native_regressions.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_parameter_updates.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_pipeline_contracts.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_saved_snapshot_budget.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_snapshot_admission.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_surface_trajectory_transform.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_training_transforms.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_trajectory_admission_cost.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_trajectory_surface_integration.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_transfer_pipeline.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_transfer_retirement_lifetimes.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_tv_zero_dependency.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_two_far_endpoints.py +0 -0
- {diffct-2.5.3 → diffct-2.5.4}/tests/test_weights.py +0 -0
|
@@ -7,6 +7,54 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.5.4] - 2026-12-06
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Distributed `Projector` construction and calls, and distributed `fbp_into` and
|
|
15
|
+
`fdk_into`, now reject an exception of any `Exception` class from a detector
|
|
16
|
+
surface, a `ParameterizedSurface` sampler or a custom store on every rank,
|
|
17
|
+
instead of only `TypeError`, `ValueError` and `RuntimeError`. Before, one rank
|
|
18
|
+
raised and its peers waited for the process group timeout. Native
|
|
19
|
+
`project_into` and `backproject_into` now report a store validation failure
|
|
20
|
+
on every rank through their geometry layout agreement
|
|
21
|
+
([#96](https://github.com/sypsyp97/diffct/pull/96)).
|
|
22
|
+
- Ranks that observe a peer's numerical-stage failure now include the peer's
|
|
23
|
+
error message in their `RuntimeError`, and a single process receives the
|
|
24
|
+
original exception object from every request validation phase
|
|
25
|
+
([#96](https://github.com/sypsyp97/diffct/pull/96)).
|
|
26
|
+
- `cgls_into` creates its zero-fill blocks on the target store's device, so a
|
|
27
|
+
caller's `torch.set_default_device` (for example `"meta"`) no longer breaks
|
|
28
|
+
CPU solves ([#96](https://github.com/sypsyp97/diffct/pull/96)).
|
|
29
|
+
- `sirt` and `tv_reconstruction` run the callback before they record history
|
|
30
|
+
entry `k` and publish checkpoint `k`. History, the stop decision and
|
|
31
|
+
checkpoints now describe the volume after the callback, which is the volume
|
|
32
|
+
that the solve continues from and returns. Projection counts per iteration
|
|
33
|
+
are unchanged, except that the first iteration after a resume with a
|
|
34
|
+
callback does one more projection
|
|
35
|
+
([#97](https://github.com/sypsyp97/diffct/pull/97)).
|
|
36
|
+
- The example `examples/_block_cgls.py` binds measurement values, trajectory
|
|
37
|
+
and detector rays into its checkpoint metadata. Resume with different
|
|
38
|
+
measurements or geometry raises `ValueError` before any write. Checkpoints
|
|
39
|
+
from earlier versions of the example are rejected
|
|
40
|
+
([#97](https://github.com/sypsyp97/diffct/pull/97)).
|
|
41
|
+
- After a failed load of its index, the documentation search loads the index
|
|
42
|
+
again on the next query change or focus on the search box, instead of
|
|
43
|
+
staying unavailable until the page reloads. Semantic search starts when the
|
|
44
|
+
index load was the only failure. A switch to keyword only while the index
|
|
45
|
+
loads shows at once and stays in force after the index recovers
|
|
46
|
+
([#95](https://github.com/sypsyp97/diffct/pull/95)).
|
|
47
|
+
|
|
48
|
+
### Documentation
|
|
49
|
+
|
|
50
|
+
- Linked the interactive browser playground from the English and Chinese
|
|
51
|
+
READMEs ([#94](https://github.com/sypsyp97/diffct/pull/94)).
|
|
52
|
+
- Documented SIRT and TV callback ordering, history, checkpointing and
|
|
53
|
+
normalizer/optimizer-moment semantics in `docs/EXECUTION.md`, and added TLA+
|
|
54
|
+
protocol coverage for solver callbacks and distributed narrow-catch failures
|
|
55
|
+
([#96](https://github.com/sypsyp97/diffct/pull/96),
|
|
56
|
+
[#97](https://github.com/sypsyp97/diffct/pull/97)).
|
|
57
|
+
|
|
10
58
|
## [2.5.3] - 2026-12-02
|
|
11
59
|
|
|
12
60
|
### Added
|
|
@@ -14,8 +14,8 @@ authors:
|
|
|
14
14
|
given-names: Yipeng
|
|
15
15
|
email: yipeng.sun@fau.de
|
|
16
16
|
alias: sypsyp97
|
|
17
|
-
version: 2.5.
|
|
18
|
-
date-released: "2026-12-
|
|
17
|
+
version: 2.5.4
|
|
18
|
+
date-released: "2026-12-06"
|
|
19
19
|
license: Apache-2.0
|
|
20
20
|
repository-code: "https://github.com/sypsyp97/diffct"
|
|
21
21
|
url: "https://sypsyp97.github.io/diffct/"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: diffct
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.4
|
|
4
4
|
Summary: Differentiable CT projection and reconstruction: precision modes, streaming, distributed execution and geometry gradients
|
|
5
5
|
Project-URL: Homepage, https://github.com/sypsyp97/diffct
|
|
6
6
|
Project-URL: Documentation, https://sypsyp97.github.io/diffct/
|
|
@@ -64,6 +64,7 @@ Description-Content-Type: text/markdown
|
|
|
64
64
|
<a href="#measured-helical-ct">Clinical CT</a> ·
|
|
65
65
|
<a href="#multi-gpu-scaling">Scaling</a> ·
|
|
66
66
|
<a href="#installation">Installation</a> ·
|
|
67
|
+
<a href="https://musetee.org/playgrounds/diffct.html">Playground</a> ·
|
|
67
68
|
<strong><a href="https://sypsyp97.github.io/diffct/">Documentation</a></strong>
|
|
68
69
|
</p>
|
|
69
70
|
|
|
@@ -179,7 +180,7 @@ Expected output: `torch.Size([180, 96]) torch.Size([64, 64])`. CPU and Apple Sil
|
|
|
179
180
|
|
|
180
181
|
## Documentation
|
|
181
182
|
|
|
182
|
-
[Quickstart](https://sypsyp97.github.io/diffct/quickstart.html) · [Trajectories and geometry](https://sypsyp97.github.io/diffct/trajectories.html) · [Clinical helical CT](https://sypsyp97.github.io/diffct/clinical_helical_example.html) · [Mayo public datasets](https://sypsyp97.github.io/diffct/mayo_datasets_example.html) · [Multi-GPU](https://sypsyp97.github.io/diffct/multi_gpu.html) · [API reference](https://sypsyp97.github.io/diffct/api.html) · [Examples](https://sypsyp97.github.io/diffct/examples.html)
|
|
183
|
+
[Quickstart](https://sypsyp97.github.io/diffct/quickstart.html) · [Trajectories and geometry](https://sypsyp97.github.io/diffct/trajectories.html) · [Clinical helical CT](https://sypsyp97.github.io/diffct/clinical_helical_example.html) · [Mayo public datasets](https://sypsyp97.github.io/diffct/mayo_datasets_example.html) · [Multi-GPU](https://sypsyp97.github.io/diffct/multi_gpu.html) · [API reference](https://sypsyp97.github.io/diffct/api.html) · [Examples](https://sypsyp97.github.io/diffct/examples.html) · [Interactive playground](https://musetee.org/playgrounds/diffct.html)
|
|
183
184
|
|
|
184
185
|
## Citation
|
|
185
186
|
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
<a href="#measured-helical-ct">Clinical CT</a> ·
|
|
32
32
|
<a href="#multi-gpu-scaling">Scaling</a> ·
|
|
33
33
|
<a href="#installation">Installation</a> ·
|
|
34
|
+
<a href="https://musetee.org/playgrounds/diffct.html">Playground</a> ·
|
|
34
35
|
<strong><a href="https://sypsyp97.github.io/diffct/">Documentation</a></strong>
|
|
35
36
|
</p>
|
|
36
37
|
|
|
@@ -146,7 +147,7 @@ Expected output: `torch.Size([180, 96]) torch.Size([64, 64])`. CPU and Apple Sil
|
|
|
146
147
|
|
|
147
148
|
## Documentation
|
|
148
149
|
|
|
149
|
-
[Quickstart](https://sypsyp97.github.io/diffct/quickstart.html) · [Trajectories and geometry](https://sypsyp97.github.io/diffct/trajectories.html) · [Clinical helical CT](https://sypsyp97.github.io/diffct/clinical_helical_example.html) · [Mayo public datasets](https://sypsyp97.github.io/diffct/mayo_datasets_example.html) · [Multi-GPU](https://sypsyp97.github.io/diffct/multi_gpu.html) · [API reference](https://sypsyp97.github.io/diffct/api.html) · [Examples](https://sypsyp97.github.io/diffct/examples.html)
|
|
150
|
+
[Quickstart](https://sypsyp97.github.io/diffct/quickstart.html) · [Trajectories and geometry](https://sypsyp97.github.io/diffct/trajectories.html) · [Clinical helical CT](https://sypsyp97.github.io/diffct/clinical_helical_example.html) · [Mayo public datasets](https://sypsyp97.github.io/diffct/mayo_datasets_example.html) · [Multi-GPU](https://sypsyp97.github.io/diffct/multi_gpu.html) · [API reference](https://sypsyp97.github.io/diffct/api.html) · [Examples](https://sypsyp97.github.io/diffct/examples.html) · [Interactive playground](https://musetee.org/playgrounds/diffct.html)
|
|
150
151
|
|
|
151
152
|
## Citation
|
|
152
153
|
|
|
@@ -155,7 +155,8 @@ def copy_blocks(source, target, elements):
|
|
|
155
155
|
def fill_blocks(target, elements):
|
|
156
156
|
for selected in _fragments(tuple(target.shape), elements):
|
|
157
157
|
shape = tuple(part.stop - part.start for part in selected)
|
|
158
|
-
|
|
158
|
+
# An explicit device keeps a caller's torch.set_default_device out of solver state.
|
|
159
|
+
target.write(selected, torch.zeros(shape, dtype=target.dtype, device=getattr(target, "device", "cpu")))
|
|
159
160
|
|
|
160
161
|
|
|
161
162
|
def update_blocks(target, source, factor, elements, scale=1.):
|
|
@@ -125,7 +125,7 @@ class AnalyticalExecution:
|
|
|
125
125
|
self.window if self.filter_response is None else None, self.pad_factor,
|
|
126
126
|
bool(self.short_scan), schema, acquisition,
|
|
127
127
|
None if self.isocenter is None else tuple(self.isocenter.tolist()))
|
|
128
|
-
except
|
|
128
|
+
except Exception as caught:
|
|
129
129
|
error = caught
|
|
130
130
|
self.partition.preflight(error, metadata)
|
|
131
131
|
self._admit_native(kwargs.get("view_chunk_size"), kwargs.get("volume_chunk_shape"))
|
|
@@ -438,7 +438,7 @@ class AnalyticalExecution:
|
|
|
438
438
|
if (isinstance(option, torch.Tensor) and isinstance(output_tensor, torch.Tensor)
|
|
439
439
|
and _tensor_overlap(option, output_tensor)):
|
|
440
440
|
raise ValueError("analytical weights and output stores overlap")
|
|
441
|
-
except
|
|
441
|
+
except Exception as caught:
|
|
442
442
|
error = caught
|
|
443
443
|
self.partition.preflight(error)
|
|
444
444
|
self.source = source
|
|
@@ -589,7 +589,7 @@ class ReferenceProjector:
|
|
|
589
589
|
raise ValueError("detector_surface output shape must match the complete detector grids")
|
|
590
590
|
metadata = (tuple(offsets.shape), str(offsets.dtype))
|
|
591
591
|
snapshots = (*tuple(value.clone() for value in frames), offsets.to(device="cpu", copy=True))
|
|
592
|
-
except
|
|
592
|
+
except Exception as failure:
|
|
593
593
|
error = failure
|
|
594
594
|
if synchronize:
|
|
595
595
|
owner._partition.preflight(error, metadata, cache_key="portable surface snapshot",
|
|
@@ -633,7 +633,7 @@ class ReferenceProjector:
|
|
|
633
633
|
views, pixels, device, validate=True, geometry=staged[device],
|
|
634
634
|
)
|
|
635
635
|
self._check_rays(origins, directions)
|
|
636
|
-
except
|
|
636
|
+
except Exception as failure:
|
|
637
637
|
error = failure
|
|
638
638
|
if synchronize:
|
|
639
639
|
owner._partition.preflight(error)
|
|
@@ -95,6 +95,10 @@ def preflight(error=None, metadata=None, *, process_group=None, world_size=1,
|
|
|
95
95
|
mismatch="distributed ranks must agree on request metadata"):
|
|
96
96
|
"""Reject invalid/disagreeing requests collectively before numerical I/O.
|
|
97
97
|
|
|
98
|
+
``error`` is the local phase's exception or None. With several ranks,
|
|
99
|
+
every rank raises the mapped class with the first failed rank's message.
|
|
100
|
+
A single process re-raises ``error`` itself.
|
|
101
|
+
|
|
98
102
|
Cache only local digest computation. Every call compares current metadata
|
|
99
103
|
across ranks, including calls through different warmed Partition objects.
|
|
100
104
|
"""
|
|
@@ -125,9 +129,12 @@ def preflight(error=None, metadata=None, *, process_group=None, world_size=1,
|
|
|
125
129
|
dist.all_gather_object(results, result, group=process_group)
|
|
126
130
|
failure = next((entry[0] for entry in results if entry[0] is not None), None)
|
|
127
131
|
if failure is not None:
|
|
132
|
+
if world_size == 1:
|
|
133
|
+
# No peer needs the error: the caller receives the original object.
|
|
134
|
+
raise error
|
|
128
135
|
classes = {kind.__name__: kind for kind in (TypeError, ValueError, RuntimeError,
|
|
129
136
|
PermissionError, FileNotFoundError, OSError)}
|
|
130
|
-
raise classes.get(failure[0], RuntimeError)(failure[1])
|
|
137
|
+
raise classes.get(failure[0], RuntimeError)(failure[1]) from error
|
|
131
138
|
if any(entry[1] != metadata for entry in results):
|
|
132
139
|
raise ValueError(mismatch)
|
|
133
140
|
if cache is not None and world_size > 1 and changed:
|
|
@@ -203,16 +210,25 @@ class Partition:
|
|
|
203
210
|
"""Agree one call's numerical outcome on every parent rank after its last collective.
|
|
204
211
|
|
|
205
212
|
A rank with a local error re-raises it. The other ranks raise
|
|
206
|
-
RuntimeError naming the failed global ranks.
|
|
213
|
+
RuntimeError naming the failed global ranks and their messages.
|
|
207
214
|
"""
|
|
208
215
|
if self.world_size > 1:
|
|
209
216
|
flags = [0] * self.world_size
|
|
210
217
|
flags[self.rank] = int(error is not None)
|
|
211
218
|
flags = control_status(flags, process_group=self.process_group, world_size=self.world_size)
|
|
212
219
|
failed = [self.ranks[index] for index, flag in enumerate(flags) if flag]
|
|
213
|
-
if
|
|
214
|
-
|
|
215
|
-
|
|
220
|
+
if failed:
|
|
221
|
+
# Only a failed call exchanges messages; a healthy call keeps one control reduction.
|
|
222
|
+
messages = [None] * self.world_size
|
|
223
|
+
with torch._C._DisableFuncTorch():
|
|
224
|
+
dist.all_gather_object(messages, None if error is None else str(error),
|
|
225
|
+
group=self.process_group)
|
|
226
|
+
if error is None:
|
|
227
|
+
details = "; ".join(f"rank {self.ranks[index]}: {message}"
|
|
228
|
+
for index, message in enumerate(messages) if message is not None)
|
|
229
|
+
raise RuntimeError(f"numerical execution failed on rank{'s' if len(failed) > 1 else ''} "
|
|
230
|
+
+ ", ".join(map(str, failed))
|
|
231
|
+
+ f"; every rank of the call raises ({details})")
|
|
216
232
|
if error is not None:
|
|
217
233
|
raise error
|
|
218
234
|
|
|
@@ -548,7 +548,8 @@ class Projector:
|
|
|
548
548
|
# Validation budgets depend on whether geometry gradients are needed.
|
|
549
549
|
self._geometry_trainable = bool(self._learnable) or surface_trainable
|
|
550
550
|
self._validate_surface_geometry(geometry, spec, devices)
|
|
551
|
-
except
|
|
551
|
+
except Exception as error:
|
|
552
|
+
# User surface code may raise any class; every rank must reach preflight.
|
|
552
553
|
validation_error = error
|
|
553
554
|
self._partition.preflight(validation_error, surface_metadata)
|
|
554
555
|
self._geometry_trainable = bool(self._learnable) or surface_trainable
|
|
@@ -643,7 +644,7 @@ class Projector:
|
|
|
643
644
|
return object()
|
|
644
645
|
return id(surface), tuple((id(value), value._version) for value in values)
|
|
645
646
|
|
|
646
|
-
def _agree_geometry_layout(self):
|
|
647
|
+
def _agree_geometry_layout(self, error=None):
|
|
647
648
|
if not (self._distributed and self.world_size > 1):
|
|
648
649
|
return
|
|
649
650
|
surface = self.detector_surface
|
|
@@ -662,7 +663,7 @@ class Projector:
|
|
|
662
663
|
# every rank must derive the same chunks.
|
|
663
664
|
metadata += (self.volume_chunk_shape, self.view_chunk_size, self.detector_chunk_shape)
|
|
664
665
|
self._partition.preflight(
|
|
665
|
-
metadata
|
|
666
|
+
error, metadata, cache_key="geometry layout", revision=self._agreement_revision(),
|
|
666
667
|
mismatch="distributed ranks must agree on geometry, trajectory dtypes, surface layout, "
|
|
667
668
|
"native volume layout and portable chunk hints",
|
|
668
669
|
)
|
|
@@ -1117,7 +1118,7 @@ class Projector:
|
|
|
1117
1118
|
else self._geometry_for(device, global_slice, geometry)
|
|
1118
1119
|
)
|
|
1119
1120
|
shards.append((device, local_slice, staged_geometry))
|
|
1120
|
-
except
|
|
1121
|
+
except Exception as failure:
|
|
1121
1122
|
error = failure
|
|
1122
1123
|
if geometry_spec is not None:
|
|
1123
1124
|
self._partition.preflight(error)
|
|
@@ -1138,7 +1139,7 @@ class Projector:
|
|
|
1138
1139
|
if not (is_project and self.beam in _BEAMS_3D and staged_input.permute(2, 1, 0).is_contiguous()):
|
|
1139
1140
|
staged_input = staged_input.contiguous()
|
|
1140
1141
|
staged.append((device, staged_input, staged_geometry))
|
|
1141
|
-
except
|
|
1142
|
+
except Exception as failure:
|
|
1142
1143
|
error = failure
|
|
1143
1144
|
if geometry_spec is not None:
|
|
1144
1145
|
self._partition.preflight(error)
|
|
@@ -1279,7 +1280,7 @@ class Projector:
|
|
|
1279
1280
|
error = None
|
|
1280
1281
|
try:
|
|
1281
1282
|
self._validate_surface_geometry(geometry, geometry_spec, plan.devices, plan)
|
|
1282
|
-
except
|
|
1283
|
+
except Exception as failure:
|
|
1283
1284
|
error = failure
|
|
1284
1285
|
self._partition.preflight(error)
|
|
1285
1286
|
chosen, pilots, cached = self._choose_schedule(source, sink, is_project, geometry, plan, geometry_spec)
|
|
@@ -2820,7 +2821,7 @@ class Projector:
|
|
|
2820
2821
|
(coincident, "source and detector surface pixels must differ"),
|
|
2821
2822
|
])
|
|
2822
2823
|
del staged
|
|
2823
|
-
except
|
|
2824
|
+
except Exception as failure:
|
|
2824
2825
|
error = failure
|
|
2825
2826
|
# None must participate too: mixed override/default calls or gradient
|
|
2826
2827
|
# layouts cannot skip a collective on only one rank.
|
|
@@ -2847,22 +2848,22 @@ class Projector:
|
|
|
2847
2848
|
def _execute_into(self, value, output, is_project):
|
|
2848
2849
|
self.last_execution_stats = None
|
|
2849
2850
|
_reset_snapshot_d2h_bytes(self)
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
try:
|
|
2853
|
-
source, sink = _validate_stores(self, value, output, is_project)
|
|
2854
|
-
except (TypeError, ValueError, RuntimeError, PermissionError) as failure:
|
|
2855
|
-
error = failure
|
|
2856
|
-
self._partition.preflight(error, (is_project, self.dtype),
|
|
2857
|
-
cache_key="operator output")
|
|
2858
|
-
else:
|
|
2851
|
+
error, source, sink = None, None, None
|
|
2852
|
+
try:
|
|
2859
2853
|
source, sink = _validate_stores(self, value, output, is_project)
|
|
2854
|
+
except Exception as failure:
|
|
2855
|
+
if self.world_size == 1:
|
|
2856
|
+
raise
|
|
2857
|
+
error = failure
|
|
2860
2858
|
if self._reference is not None:
|
|
2859
|
+
if self.world_size > 1:
|
|
2860
|
+
self._partition.preflight(error, (is_project, self.dtype), cache_key="operator output")
|
|
2861
2861
|
with torch.no_grad():
|
|
2862
2862
|
self._reference.into(source, sink, is_project)
|
|
2863
2863
|
return output
|
|
2864
2864
|
with torch.no_grad():
|
|
2865
|
-
|
|
2865
|
+
# Native execution carries a store validation error in its first agreement.
|
|
2866
|
+
plan, geometry_spec, geometry = self._prepare_execution(source, is_project, sink, error)
|
|
2866
2867
|
if (self.world_size == 1 and geometry_spec is not None
|
|
2867
2868
|
and geometry_spec.kind == "sampled"):
|
|
2868
2869
|
# Caller-owned outputs must stay intact if a later batch is invalid.
|
|
@@ -2875,7 +2876,8 @@ class Projector:
|
|
|
2875
2876
|
"""Alias for :meth:`project`."""
|
|
2876
2877
|
return self.project(volume, trajectory=trajectory)
|
|
2877
2878
|
|
|
2878
|
-
def _prepare_execution(self, tensor, is_project, output_store=None):
|
|
2879
|
+
def _prepare_execution(self, tensor, is_project, output_store=None, error=None):
|
|
2880
|
+
self._agree_geometry_layout(error)
|
|
2879
2881
|
device = torch.device(getattr(tensor, "device", "cpu"))
|
|
2880
2882
|
if self.detector_surface is not None:
|
|
2881
2883
|
# Only eligible full calls need a preliminary snapshot reservation.
|
|
@@ -2904,7 +2906,6 @@ class Projector:
|
|
|
2904
2906
|
return plan, spec, geometry
|
|
2905
2907
|
|
|
2906
2908
|
def _effective_geometry(self, plan, input_device):
|
|
2907
|
-
self._agree_geometry_layout()
|
|
2908
2909
|
if self.detector_surface is None:
|
|
2909
2910
|
if plan is not None:
|
|
2910
2911
|
_add_snapshot_d2h_bytes(
|
|
@@ -2966,7 +2967,7 @@ class Projector:
|
|
|
2966
2967
|
for value, snapshot in zip(values, snapshots)
|
|
2967
2968
|
if value.is_cuda and not snapshot.is_cuda),
|
|
2968
2969
|
)
|
|
2969
|
-
except
|
|
2970
|
+
except Exception as failure:
|
|
2970
2971
|
error = failure
|
|
2971
2972
|
self._partition.preflight(error, metadata, cache_key="surface snapshot",
|
|
2972
2973
|
revision=self._agreement_revision())
|
|
@@ -119,6 +119,18 @@ def _after_iteration(operator, checkpoint_directory, states, metadata, completed
|
|
|
119
119
|
return False
|
|
120
120
|
|
|
121
121
|
|
|
122
|
+
def _finish_iteration(operator, callbacks, callback, completed, history, volume, residual_of):
|
|
123
|
+
"""Run the callback, then record the residual of the iterate the next step uses."""
|
|
124
|
+
residual, stopped = residual_of(), False
|
|
125
|
+
if callbacks:
|
|
126
|
+
before = math.sqrt(squared_norm(operator, residual, "rays"))
|
|
127
|
+
stopped = callback_stop(operator, callback, completed, before, volume)
|
|
128
|
+
# The callback may change the iterate or the operator in place.
|
|
129
|
+
residual = residual_of()
|
|
130
|
+
history.append(math.sqrt(squared_norm(operator, residual, "rays")))
|
|
131
|
+
return residual, stopped
|
|
132
|
+
|
|
133
|
+
|
|
122
134
|
def _init_cgls(operator, data, x0, iterations, rtol, atol):
|
|
123
135
|
x = _initial(operator, data, x0)
|
|
124
136
|
residual = data.clone() if x0 is None else data - operator.project(x)
|
|
@@ -221,19 +233,19 @@ def sirt(operator, measurements, iterations=100, *, x0=None, rtol=1e-6, atol=0.,
|
|
|
221
233
|
states, completed, history, norm, residual = _init_sirt(operator, data, x0, iterations, rtol, atol)
|
|
222
234
|
threshold, stopped = atol + rtol * norm, False
|
|
223
235
|
while completed < iterations and history[-1] > threshold:
|
|
224
|
-
|
|
225
|
-
if callbacks or residual is None:
|
|
236
|
+
if residual is None:
|
|
226
237
|
residual = data - operator.project(states["x"])
|
|
227
238
|
states["x"].add_(states["column"] * operator.backproject(states["row"] * residual), alpha=relaxation)
|
|
228
239
|
if nonnegative:
|
|
229
240
|
states["x"].clamp_(min=0)
|
|
230
241
|
completed += 1
|
|
231
|
-
residual =
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
operator, checkpoint_directory, states, metadata, completed, history, norm,
|
|
235
|
-
1048576, callbacks, callback, states["x"],
|
|
242
|
+
residual, stopped = _finish_iteration(
|
|
243
|
+
operator, callbacks, callback, completed, history, states["x"],
|
|
244
|
+
lambda: data - operator.project(states["x"]),
|
|
236
245
|
)
|
|
246
|
+
if checkpoint_directory is not None:
|
|
247
|
+
save_checkpoint(operator, checkpoint_directory, states, metadata, completed, history,
|
|
248
|
+
norm, 1048576)
|
|
237
249
|
if stopped:
|
|
238
250
|
break
|
|
239
251
|
converged, reason = _status(history[-1], threshold, stopped)
|
|
@@ -276,7 +288,7 @@ def tv_reconstruction(operator, measurements, iterations=100, weight=1., lr=.1,
|
|
|
276
288
|
threshold, stopped = atol + rtol * norm, False
|
|
277
289
|
ray_count = scalar_sum(operator, data.numel(), "rays")
|
|
278
290
|
while completed < iterations and history[-1] > threshold:
|
|
279
|
-
if
|
|
291
|
+
if residual is None:
|
|
280
292
|
residual = operator.project(x) - data
|
|
281
293
|
gradient = operator.backproject(residual) / max(ray_count, 1)
|
|
282
294
|
if weight:
|
|
@@ -289,14 +301,14 @@ def tv_reconstruction(operator, measurements, iterations=100, weight=1., lr=.1,
|
|
|
289
301
|
optimizer.step()
|
|
290
302
|
x.clamp_(min=0)
|
|
291
303
|
completed += 1
|
|
292
|
-
residual =
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
if checkpoint_directory is not None else None)
|
|
296
|
-
stopped = _after_iteration(
|
|
297
|
-
operator, checkpoint_directory, states, metadata, completed, history, norm,
|
|
298
|
-
1048576, callbacks, callback, x.detach(),
|
|
304
|
+
residual, stopped = _finish_iteration(
|
|
305
|
+
operator, callbacks, callback, completed, history, x.detach(),
|
|
306
|
+
lambda: operator.project(x) - data,
|
|
299
307
|
)
|
|
308
|
+
if checkpoint_directory is not None:
|
|
309
|
+
states = {**optimizer.state[x], "x": x, "step": optimizer.state[x]["step"].reshape(1)}
|
|
310
|
+
save_checkpoint(operator, checkpoint_directory, states, metadata, completed, history,
|
|
311
|
+
norm, 1048576)
|
|
300
312
|
if stopped:
|
|
301
313
|
break
|
|
302
314
|
converged, reason = _status(history[-1], threshold, stopped)
|