Skip to content

ENH: mark that large allocations can use huge pages - #11957

Merged
charris merged 3 commits into
numpy:masterfrom
juliantaylor:hugepages
Sep 22, 2018
Merged

charris merged 3 commits into
numpy:masterfrom
juliantaylor:hugepages

Conversation

@juliantaylor

@juliantaylor juliantaylor commented Sep 15, 2018 •

Copy link
Copy Markdown
Contributor

On distributions with /sys/kernel/mm/transparent_hugepage/enabled set to
madvise we do not automatically get our memory backed by huge pages.
Explicitly madvise these regions so they can use larger pages.

This improves performance of the common large array allocation/free
cycle in numpy as page fault overhead is reduced.

asv continuous -E virtualenv:3.6 --bench bench_io.Copy HEAD^ HEAD

  2.64±0.3ms      1.99±0.06ms     0.75  bench_io.Copy.time_memcpy_large_out_of_place('float32')
  5.51±0.2ms       3.74±0.3ms     0.68  bench_io.Copy.time_memcpy_large_out_of_place('float64')
 4.76±0.02μs      3.02±0.04μs     0.63  bench_io.Copy.time_cont_assign('float32')
  5.55±0.1ms       3.31±0.1ms     0.60  bench_io.Copy.time_memcpy_large_out_of_place('complex64')
  11.3±0.2ms       6.26±0.2ms     0.56  bench_io.Copy.time_memcpy_large_out_of_place('complex128')

Closes gh-11919

@juliantaylor juliantaylor changed the title Hugepages ENH: mark that large allocations can use huge pages Sep 15, 2018
@juliantaylor
juliantaylor force-pushed the hugepages branch 2 times, most recently from df91046 to 7c62a9c Compare September 15, 2018 10:07
@charris

charris commented Sep 19, 2018

Copy link
Copy Markdown
Member

@juliantaylor Could you add an entry to the release notes under Improvements?

@juliantaylor

Copy link
Copy Markdown
Contributor Author

done

On distributions with /sys/kernel/mm/transparent_hugepage/enabled set to
madvise we do not automatically get our memory backed by huge pages.
Explicitly madvise these regions so they can use larger pages.

This improves performance of the common large array allocation/free
cycle in numpy as page fault overhead is reduced.

    asv continuous -E virtualenv:3.6 --bench bench_io.Copy HEAD^ HEAD

      2.64±0.3ms      1.99±0.06ms     0.75  bench_io.Copy.time_memcpy_large_out_of_place('float32')
      5.51±0.2ms       3.74±0.3ms     0.68  bench_io.Copy.time_memcpy_large_out_of_place('float64')
     4.76±0.02μs      3.02±0.04μs     0.63  bench_io.Copy.time_cont_assign('float32')
      5.55±0.1ms       3.31±0.1ms     0.60  bench_io.Copy.time_memcpy_large_out_of_place('complex64')
      11.3±0.2ms       6.26±0.2ms     0.56  bench_io.Copy.time_memcpy_large_out_of_place('complex128')

Closes numpygh-11919
@charris
charris merged commit 31f1964 into numpy:master Sep 22, 2018
@charris

charris commented Sep 22, 2018

Copy link
Copy Markdown
Member

Thanks Julian.

@juliantaylor
juliantaylor deleted the hugepages branch October 16, 2018 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants