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

MakiePlotter rewrite with ShaderAbstractions.Buffer #69

Merged
merged 13 commits into from
Mar 23, 2023
Merged

Conversation

koehlerson
Copy link
Member

@koehlerson koehlerson commented Mar 16, 2023

Change

  • MakiePlotter caches now by creation a GeometryBasics.Mesh
    • the underlying mesh uses ShaderAbstractions.Buffer for the triangles and positions
  • a copy of all triangles and the triangle coords without displacement is within the plotter
  • Made a few recipes more readible by getting rid of ternary operators and used begin end instead

Needed Makie PRs

Removed functions

  • facedofs
  • FerriteViz.to_triangles
  • visible

Timings

solutionplot

Makie version FerriteViz version plasticity incompressible-elasticity heat-3D-70^3
master mk/buffer 817048d 17.866 ms (50939 allocations: 3.92 MiB) 31.648 ms (98402 allocations: 7.66 MiB) 6.100 s (38224 allocations: 1.20 GiB)
master mk/buffer ece12d9 17.272 ms (84065 allocations: 6.96 MiB) 40.331 ms (218408 allocations: 22.30 MiB) 8.397 s (4152021 allocations: 1.69 GiB)
master master 19.213 ms (101569 allocations: 8.10 MiB) 47.713 ms (317502 allocations: 28.85 MiB) 15.122 s (11007449 allocations: 2.34 GiB)
v0.19.2 master 28.692 ms (374363 allocations: 21.19 MiB) 56.697 ms (557250 allocations: 40.28 MiB) 70.740 s (603707659 allocations: 29.94 GiB)

@koehlerson koehlerson linked an issue Mar 16, 2023 that may be closed by this pull request
@koehlerson
Copy link
Member Author

remaining big alloc problem for 70^3 elements in heat equation example:

julia> mesh = GeometryBasics.Mesh(collect(plotter.physical_coords),collect(plotter.vis_triangles));

julia> @btime GLMakie.mesh(mesh)
  456.759 ms (33435 allocations: 2.32 MiB)

julia> @btime GLMakie.mesh(plotter.mesh)
  829.511 ms (33447 allocations: 755.98 MiB)

julia> typeof(mesh)
GeometryBasics.Mesh{3, Float32, GeometryBasics.Ngon{3, Float32, 3, GeometryBasics.Point{3, Float32}}, GeometryBasics.SimpleFaceView{3, Float32, 3, GeometryBasics.OffsetInteger{-1, UInt32}, GeometryBasics.Point{3, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}

julia> typeof(plotter.mesh)
GeometryBasics.Mesh{3, Float32, GeometryBasics.Ngon{3, Float32, 3, GeometryBasics.Point{3, Float32}}, GeometryBasics.FaceView{GeometryBasics.Ngon{3, Float32, 3, GeometryBasics.Point{3, Float32}}, GeometryBasics.Point{3, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, ShaderAbstractions.Buffer{GeometryBasics.Point{3, Float32}, Vector{GeometryBasics.Point{3, Float32}}}, ShaderAbstractions.Buffer{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}

@termi-official
Copy link
Member

Does pprof expose something useful?

@koehlerson
Copy link
Member Author

koehlerson commented Mar 17, 2023

Does pprof expose something useful?

Haven't checked it yet, Todo for next week maybe

Copy link
Member

@termi-official termi-official left a comment

Choose a reason for hiding this comment

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

LGTM otherwise.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Dennis Ogiermann <[email protected]>
@koehlerson koehlerson merged commit c070140 into master Mar 23, 2023
@koehlerson koehlerson deleted the mk/buffer branch March 23, 2023 12:50
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.

Reduction of Allocations -> make FerriteViz go vroom
2 participants