Transparent Huge Pages (THPs) are a Linux kernel feature for memory management to improve performance of the application by efficiently using processor's memory-mapping hardware. THP should reduce the overhead of the Translation Lookaside Buffer. It operates mainly in two modes:
-
always: In this mode, the system kernel tries to assign huge pages to the processes
running on the system. You can run the following command to set THP to
always.echo always > /sys/kernel/mm/transparent_hugepage/enabled -
madvise: In this mode, the kernel only assigns huge
pages to the individual processes memory areas. You can run the following command to
set THP to
madvise.echo madvise > /sys/kernel/mm/transparent_hugepage/enabled
Disable THP
Log in as
root to enable or disable THP settings. Use the
following command to disable
THP.echo never > /sys/kernel/mm/transparent_hugepage/enabled
These are the recommended THP settings for better performance.
- For zentorch
- CNN models:
always - NLP and LLM models:
madvise
- CNN models:
- For zentf
- CNN models:
never(batch size =1),always(batch size >1) - NLP and Recommender models:
madvise
- CNN models: