Skip to content

Commit

Permalink
Merge pull request #71 from duggalsu/fix_vid_vec_graviton_dockerfile
Browse files Browse the repository at this point in the history
Fix Graviton commands
  • Loading branch information
duggalsu authored Feb 9, 2024
2 parents 09c320d + f3893aa commit 72bd171
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/api/Dockerfile.vid_vec_rep_resnet
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,24 @@ RUN pip install --no-cache-dir --user -r /app/core/operators/vid_vec_rep_resnet_

### AWS Graviton Optimization ###
# Graviton3(E) (e.g. c7g, c7gn and Hpc7g instances) supports BF16 format for ML acceleration. This can be enabled in oneDNN by setting the below environment variable
grep -q bf16 /proc/cpuinfo && export DNNL_DEFAULT_FPMATH_MODE=BF16
ENV DNNL_DEFAULT_FPMATH_MODE=BF16

# Enable primitive caching to avoid the redundant primitive allocation
# latency overhead. Please note this caching feature increases the
# memory footprint. Tune this cache capacity to a lower value to
# reduce the additional memory requirement.
export LRU_CACHE_CAPACITY=1024
ENV LRU_CACHE_CAPACITY=1024

# Enable Transparent huge page allocations from PyTorch C10 allocator
export THP_MEM_ALLOC_ENABLE=1
ENV THP_MEM_ALLOC_ENABLE=1

# Make sure the openmp threads are distributed across all the processes for multi process applications to avoid over subscription for the vcpus. For example if there is a single application process, then num_processes should be set to '1' so that all the vcpus are assigned to it with one-to-one mapping to omp threads
num_vcpus=$(getconf _NPROCESSORS_ONLN)
num_processes=1
export OMP_NUM_THREADS=$((1 > ($num_vcpus/$num_processes) ? 1 : ($num_vcpus/$num_processes)))
export OMP_PROC_BIND=false
export OMP_PLACES=cores
# RUN num_vcpus=8
# RUN num_processes=1
# RUN temp = $((1 > ($num_vcpus/$num_processes) ? 1 : ($num_vcpus/$num_processes)))
ENV OMP_NUM_THREADS=1
ENV OMP_PROC_BIND=false
ENV OMP_PLACES=cores
###

COPY ./core/operators/vid_vec_rep_resnet.py /app/core/operators/vid_vec_rep_resnet.py
Expand Down

0 comments on commit 72bd171

Please sign in to comment.