Skip to content
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

Shorter printing of default detectors #190

Merged
merged 5 commits into from
Sep 5, 2024
Merged

Shorter printing of default detectors #190

merged 5 commits into from
Sep 5, 2024

Conversation

adrhill
Copy link
Owner

@adrhill adrhill commented Sep 5, 2024

Closes #189 with copy-pasteable outputs:

julia> TracerSparsityDetector()
TracerSparsityDetector()


julia> TracerSparsityDetector(gradient_tracer_type=SparseConnectivityTracer.GradientTracer{SparseConnectivityTracer.IndexSetGradientPattern{Int,Set{Int}}})
TracerSparsityDetector{SparseConnectivityTracer.GradientTracer{SparseConnectivityTracer.IndexSetGradientPattern{Int64, Set{Int64}}},SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.DictHessianPattern{Int64, BitSet, Dict{Int64, BitSet}, SparseConnectivityTracer.NotShared}}}()


julia> # Output can be copied and pasted:

julia> TracerSparsityDetector{SparseConnectivityTracer.GradientTracer{SparseConnectivityTracer.IndexSetGradientPattern{Int64, Set{Int64}}},SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.DictHessianPattern{Int64, BitSet, Dict{Int64, BitSet}, SparseConnectivityTracer.NotShared}}}()
TracerSparsityDetector{SparseConnectivityTracer.GradientTracer{SparseConnectivityTracer.IndexSetGradientPattern{Int64, Set{Int64}}},SparseConnectivityTracer.HessianTracer{SparseConnectivityTracer.DictHessianPattern{Int64, BitSet, Dict{Int64, BitSet}, SparseConnectivityTracer.NotShared}}}()

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.90%. Comparing base (45be93b) to head (da4016a).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/adtypes_interface.jl 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #190      +/-   ##
==========================================
+ Coverage   90.88%   91.90%   +1.01%     
==========================================
  Files          48       48              
  Lines        2106     2087      -19     
==========================================
+ Hits         1914     1918       +4     
+ Misses        192      169      -23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adrhill
Copy link
Owner Author

adrhill commented Sep 5, 2024

I removed the Base.show utilities on internals, since they were never used.
To succinctly print tracer contents for debugging purposes, simply call gradient or hessian on tracers. This will print the underlying data structures.

@adrhill adrhill merged commit 87f026a into main Sep 5, 2024
6 checks passed
@adrhill adrhill deleted the ah/detector-printing branch September 5, 2024 15:39
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.

More concise printing of detector type?
2 participants