Internal:CDT3D GPU Smoothing: Difference between revisions

From crtc.cs.odu.edu
Jump to navigation Jump to search
Spyridon97 (talk | contribs)
Spyridon97 (talk | contribs)
m Spyridon97 moved page Internal:CDT3D to Internal:CDT3D GPU Smoothing
 
(11 intermediate revisions by the same user not shown)
Line 149: Line 149:
###### Reduction using global values and ids arrays(16+16) on GPU, grid(1) block(16)
###### Reduction using global values and ids arrays(16+16) on GPU, grid(1) block(16)
###### Original point value on CPU concurrently with steps 3 & 4
###### Original point value on CPU concurrently with steps 3 & 4
### Parallel GPU-wise:
##### Time:
###### lock time: 0.0190836 sec
###### findCavityCells time: 0.178939 sec
###### findUniqueVertices time: 0.215159 sec
###### dataCollection time: 0.187204 sec
###### boundingBox time: 0.0280833 sec
###### grid time: 0.00122939 sec
###### originalPointValue time: 0.12965 sec
###### assignNewPoint time: 0.00165265 sec
###### unlock time: 0.0117685 sec
###### Total Cpu time: 0.77277 sec
### Parallel CPU-wise:
#### Version 4:
#### Version 4:
##### Speed-Up:✔<br>[[File:Smoothing_Speed-up-heterogeneous.png|750px|Smoothing_Speed-up-heterogeneous.png]]
##### Speed-Up:✔<br>[[File:Smoothing_Speed-up-heterogeneous.png|750px|Smoothing_Speed-up-heterogeneous.png]]
##### Rollbacks-Time-Per-Thread:✔<br>[[File:parallel.v4.png|750px|parallel.v4.png]]
##### Rollbacks-Time-Per-Thread:✔<br>[[File:parallel.v4.png|750px|parallel.v4.png]]
##### Profiler: 4 cpu threads, 4 streams✔<br> [[File:profiler.v4.png|750px|profiler.v4.png]]
#### Version 4.1:
##### Profiler: 2 cpu threads, 2(copy)+8(computation) streams✔<br> [[File:profiler.v4.1.png|750px|profiler.v4.1.png]]
#### Version 4.2:
#### Version 4.2:
##### Rollbacks-Time-Per-Thread:✔<br>[[File:parallel.v4.2.png|750px|parallel.v4.2.png]]
##### Rollbacks-Time-Per-Thread (#vertices = 28,217):✔<br>[[File:parallel.v4.2.png|750px|parallel.v4.2.png]]
##### Rollbacks-Time-Per-Thread (#vertices = 79,809):✔<br>[[File:parallel.v4.2-double-size.png|750px|parallel.v4.2-double-size.png]]
###### CPU (1 thread) 666 sec, CPU (32 threads) 28.29 sec
##### Profiler: 2 cpu threads, 2(copy)+8(computation) streams✔<br> [[File:profiler.v4.2.png|750px|profiler.v4.2.png]]
##### CPU Time Histogram 1 thread:✔<br>[[File:Histogram_of_CPU_Batch_Time_v4.2_threads=1.png|750px|Histogram_of_CPU_Batch_Time_v4.2_threads=1.png]]
##### CPU Time Histogram 2 threads:✔<br>[[File:Histogram_of_CPU_Batch_Time_v4.2_threads=2.png|750px|Histogram_of_CPU_Batch_Time_v4.2_threads=2.png]]

Latest revision as of 16:15, 14 April 2021

Presentations

Spring 2021

  1. A Unified Approach for Parallel Mesh Operations by Christos✔
  2. GPU Architecture ✔

Code

Spring 2021

  1. Discrete Mesh Optimization using the paper: Discrete Mesh Optimization on GPU, The results below are using the tet_shape metric from the Verdict library
    1. CPU version:
      1. Sequential:
        1. Dihedral Quality of Discrete Vertex smoothing with Global Iterations:✔
          Discrete_Vertex_Smoothing_Dihedral_Angle_Quality_Global_Iterations.png
        2. Dihedral Quality of different smoothing methods:✔
          Vertex_Smoothing_Methods_Dihedral_Angle_Quality.png
        3. Shape Quality of different smoothing methods:✔
          Shape_Quality.png
        4. Distribution of Smoothing Time Per Vertex:✔
          Distribution_of_Smoothing_Time_Per_Vertex_CPU.png
      2. Parallel:
        1. Dihedral Quality: Sequential vs Parallel:✔
          Discrete_Vertex_Smoothing_Dihedral_Angle_Quality.png
        2. Speed-Up:✔
          Smoothing_Speed-up.png
        3. RollBacks✔:
          Percentage_of_Rollbacks_per_Iteration.png
    2. GPU version:
      1. Sequential CPU-wise:
        1. Distribution of Smoothing Time Per Vertex:✔
          Distribution_of_Smoothing_Time_Per_Vertex_GPU.png
        2. Version 1 (all points copied):
          1. Steps:
            1. Bounding box on GPU, grid(1) block(1)
            2. Original point value on GPU, grid(1) block(1)
            3. Grid creation on GPU, grid(1) block(1)
            4. Gridpoint values using global values array(512) on GPU, grid(2, 2, 2) block(4, 4, 4)
            5. Reduction using global values array(512) on GPU, grid(1) block(1)
          2. Time total = 18.563 sec (90 sec on CPU sequential)
            1. CPU = 0.79182 sec
            2. Steps 1 & 2 = 8.31743 sec
            3. Step 3 = 1.03768 sec
            4. Step 4 = 6.55488 sec (per point)
            5. Step 5 = 1.73327 sec
            6. MemCopyH2D = 0.12792 sec
            7. MemCopyD2H = 0.00002 sec
        3. Version 2.0 (copy what you need):
          1. Steps:
            1. Bounding box on CPU
            2. Grid creation on CPU
            3. Gridpoint values using global values array(512) on GPU, grid(2, 2, 2) block(4, 4, 4)
            4. Reduction using global values array(512) on GPU, grid(1) block(1)
              1. !!! Note: access global memory multiple times !!!
            5. Original point value on CPU concurrently with steps 3 & 4
          2. Time total = 15.06656 sec
            1. CPU = 1.8857 sec (all cavities)
            2. Step 3 = 6.43994 sec
            3. Step 4 = 6.20552 sec
            4. MemCopyH2D = 0.38211 sec
            5. MemCopyD2H = 0.15329 sec
        4. Version 2.1 (copy what you need):
          1. Steps:
            1. Bounding box on CPU
            2. Grid creation on CPU
            3. Gridpoint values using global values array(512) on GPU, grid(2, 2, 2) block(4, 4, 4)
            4. Reduction using global values array(512) on GPU, grid(1) block(1)
            5. Original point value on CPU concurrently with steps 3 & 4
          2. Time total = 10.8227 sec
            1. CPU = 1.8857 sec
            2. Step 3 = 6.47006 sec
            3. Step 4 = 1.74147 sec
            4. MemCopyH2D = 0.37493 sec
            5. MemCopyD2H = 0.15225 sec
        5. Version 3 (copy what you need):
          1. Steps:
            1. Bounding box on CPU
            2. Grid creation on CPU
            3. Gridpoint values using global values and ids arrays(8+8) and reduction for the max value and id of a block on GPU, grid(8) block(64)
            4. Reduction using global values and ids arrays(8+8) on GPU, grid(1) block(8)
            5. Original point value on CPU concurrently with steps 3 & 4
          2. Time total = 9.17189 sec
            1. CPU = 2.04448 sec
            2. Step 3 = 6.40427 sec
            3. Step 4 = 0.19378 sec
            4. MemCopyH2D = 0.37604 sec
            5. MemCopyD2H = 0.15332 sec
        6. Version 3.1 (copy what you need):
          1. Steps:
            1. Bounding box on CPU
            2. Grid creation on CPU
            3. Gridpoint values using global values and ids arrays(16+16) and reduction for the max value and id of a block on GPU, grid(16) block(32)
            4. Reduction using global values and ids arrays(16+16) on GPU, grid(1) block(16)
            5. Original point value on CPU concurrently with steps 3 & 4
          2. Time total = 8.77189 sec
            1. CPU = 2.04448 sec (Data Transformation = 0.194 sec)
            2. Step 3 = 6.0427 sec
            3. Step 4 = 0.19378 sec
            4. MemCopyH2D = 0.37604 sec
            5. MemCopyD2H = 0.15332 sec
        7. Version 3.2 (allocate what you need at the beginning & copy what you need):
          1. Steps:
            1. Bounding box on CPU
            2. Grid creation on CPU
            3. Gridpoint values using global values and ids arrays(16+16) and reduction for the max value and id of a block on GPU, grid(16) block(32)
            4. Reduction using global values and ids arrays(16+16) on GPU, grid(1) block(16)
            5. Original point value on CPU concurrently with steps 3 & 4
          2. Time total = 8.34358 sec
            1. CPU = 1.58702 sec
            2. Step 3 = 6.02387s sec
            3. Step 4 = 0.20711ms sec
            4. MemCopyH2D = 0.37380 sec
            5. MemCopyD2H = 0.15178 sec
        8. Version 3.3 (allocate what you need at the beginning & copy what you need & and combine the GPU data):
          1. Steps:
            1. Bounding box on CPU
            2. Grid creation on CPU
            3. Gridpoint values using global values and ids arrays(16+16) and reduction for the max value and id of a block on GPU, grid(16) block(32)
            4. Reduction using global values and ids arrays(16+16) on GPU, grid(1) block(16)
            5. Original point value on CPU concurrently with steps 3 & 4
          2. Time total = 8.06576 sec
            1. CPU = 1.466553 sec
            2. Step 3 = 5.99690 sec
            3. Step 4 = 0.20702 sec
            4. MemCopyH2D = 0.25319 sec
            5. MemCopyD2H = 0.078917 sec
        9. Version 4 (perfom batching with 1 stream per cpu-thread):
          1. For a batch of 4 vertices:
          2. Steps:
            1. Bounding box on CPU
            2. Grid creation on CPU
            3. Gridpoint values using global values and ids arrays(16+16) and reduction for the max value and id of a block on GPU, grid(16) block(32)
            4. Reduction using global values and ids arrays(16+16) on GPU, grid(1) block(16)
            5. Original point value on CPU concurrently with steps 3 & 4
          3. Time total = 7.18418 sec
            1. CPU = 0.946749 sec
            2. Step 3 = 5.94023 sec
            3. Step 4 = 0.20709 sec
            4. MemCopyH2D = 0.069697 sec
            5. MemCopyD2H = 0.020414 sec
          4. Batch size:✔
            BATCH-SIZE.v4.png
        10. Version 4.1 (perfom batching with #streams = batch-size within each cpu-thread):
          1. For a batch of 4 vertices
          2. Steps:
            1. Bounding box on CPU
            2. Grid creation on CPU
            3. Gridpoint values using global values and ids arrays(16+16) and reduction for the max value and id of a block on GPU, grid(16) block(32)
            4. Reduction using global values and ids arrays(16+16) on GPU, grid(1) block(16)
            5. Original point value on CPU concurrently with steps 3 & 4
        11. Version 4.2 (perfom batching with #streams = << batch-size within each cpu-thread):
          1. For a batch of 12 vertices with 4 streams
          2. Steps:
            1. Bounding box on CPU
            2. Grid creation on CPU
            3. Gridpoint values using global values and ids arrays(16+16) and reduction for the max value and id of a block on GPU, grid(16) block(32)
            4. Reduction using global values and ids arrays(16+16) on GPU, grid(1) block(16)
            5. Original point value on CPU concurrently with steps 3 & 4
          3. Time:
            1. lock time: 0.0190836 sec
            2. findCavityCells time: 0.178939 sec
            3. findUniqueVertices time: 0.215159 sec
            4. dataCollection time: 0.187204 sec
            5. boundingBox time: 0.0280833 sec
            6. grid time: 0.00122939 sec
            7. originalPointValue time: 0.12965 sec
            8. assignNewPoint time: 0.00165265 sec
            9. unlock time: 0.0117685 sec
            10. Total Cpu time: 0.77277 sec
      2. Parallel CPU-wise:
        1. Version 4:
          1. Speed-Up:✔
            Smoothing_Speed-up-heterogeneous.png
          2. Rollbacks-Time-Per-Thread:✔
            parallel.v4.png
          3. Profiler: 4 cpu threads, 4 streams✔
            profiler.v4.png
        2. Version 4.1:
          1. Profiler: 2 cpu threads, 2(copy)+8(computation) streams✔
            profiler.v4.1.png
        3. Version 4.2:
          1. Rollbacks-Time-Per-Thread (#vertices = 28,217):✔
            parallel.v4.2.png
          2. Rollbacks-Time-Per-Thread (#vertices = 79,809):✔
            parallel.v4.2-double-size.png
            1. CPU (1 thread) 666 sec, CPU (32 threads) 28.29 sec
          3. Profiler: 2 cpu threads, 2(copy)+8(computation) streams✔
            profiler.v4.2.png
          4. CPU Time Histogram 1 thread:✔
            Histogram_of_CPU_Batch_Time_v4.2_threads=1.png
          5. CPU Time Histogram 2 threads:✔
            Histogram_of_CPU_Batch_Time_v4.2_threads=2.png