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

Fast strict transform under toric blowups #4484

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

paemurru
Copy link
Contributor

@paemurru paemurru commented Jan 17, 2025

I improved the speed of strict_transform for an arbitrary toric blowup. More precisely, I improved cox_ring_module_homomorphism, which is used for strict_transform, total_transform and strict_transform_with_index. The main time-saving techniques:

  • using MPolyBuildCtx to create the polynomial, instead of iteratively adding terms to a polynomial,
  • using Vector{Rational{Int64}} instead of Vector{QQFieldElem} for the vector ps,
  • using Vector{Int64} for the vector ps in the special case where the denominators are 1.

Some small other improvements in the core loop:

  • using first(exponents(g)) instead of collect(exponents(g))[1],
  • using exps = [exps; exceptional_exp] instead of push!(exps, exceptional_exp) reduces allocated memory by about 35% --- I am puzzled why there is a difference here.

The function strict_transform now seems to be faster than the specialized _strict_transform in FTheoryTools that could compute strict transform only under blowups along smooth cones. So I removed the specialized function.

Also, I added a test for computing the strict transform when blowing up along an existing ray.

Benchmarks

I used the F-Theory computations from @HereAround . Namely, I first commented out lines 797--803 of experimental/FTheoryTools/src/AbstractFTheoryModels/methods.jl

  # For model 1511.03209 and resolution_index = 1, a particular resolution is available from an artifact
#   if has_attribute(m, :arxiv_id)
#     if resolution_index == 1 && arxiv_id(m) == "1511.03209"
#       model_data_path = artifact"FTM-1511-03209/1511-03209-resolved.mrdi"
#       return load(model_data_path)
#     end
#   end

and edited line 821 of the same file from for k in 1:nr_blowups to for k in 1:5 to have a faster test.

Then ran

h = literature_model(arxiv_id = "1511.03209")
@btime h_5 = resolve(h, 1)

Results

Previously:

julia> @btime h_5 = resolve(h, 1)
  190.106 s (44395903 allocations: 10.13 GiB)
Partially resolved global Tate model over a concrete base -- The F-theory geometry with most flux vacua based on arXiv paper 1511.03209 Eq. (2.11)

Now:

julia> @btime h_5 = resolve(h, 1)
  188.573 s (38064085 allocations: 6.42 GiB)
Partially resolved global Tate model over a concrete base -- The F-theory geometry with most flux vacua based on arXiv paper 1511.03209 Eq. (2.11)

Improvements

  • time is roughly the same (the exact time changes by a few seconds every run),
  • there are now 14% fewer allocation instances compared to the specialized function in FTheoryTools,
  • 37% less memory used for allocations than the specialized function in FTheoryTools.

@paemurru paemurru changed the title Ep/fast toric strict transform Ep/fast strict transform under toric blowups Jan 17, 2025
@paemurru paemurru changed the title Ep/fast strict transform under toric blowups Fast strict transform under toric blowups Jan 17, 2025
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 84.39%. Comparing base (1f7ded1) to head (46ad165).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
experimental/FTheoryTools/src/auxiliary.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4484      +/-   ##
==========================================
+ Coverage   84.37%   84.39%   +0.01%     
==========================================
  Files         672      672              
  Lines       88717    88690      -27     
==========================================
- Hits        74855    74847       -8     
+ Misses      13862    13843      -19     
Files with missing lines Coverage Δ
.../FTheoryTools/src/AbstractFTheoryModels/methods.jl 78.00% <100.00%> (ø)
experimental/Schemes/src/ToricBlowups/methods.jl 96.07% <100.00%> (+0.24%) ⬆️
experimental/FTheoryTools/src/auxiliary.jl 79.83% <0.00%> (+3.83%) ⬆️

... and 4 files with indirect coverage changes

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.

1 participant