tensorflow / tensorflow/java

Not utilising AVX2 instructions after compilation from sources

Đang mở
#98 11 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Java
Star
928
Fork
227
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

System information

  • OS Platform and Distribution: Linux Ubuntu 20.04
  • TensorFlow installed from (source or binary): built via "mvn install"
  • TensorFlow version: 2.3 (using 0.2.0-SNAPSHOT)
  • Python version: 3.8.2
  • Bazel version (if compiling from source): 3.4.1
  • GCC/Compiler version (if compiling from source): 9.3.0

Problem:

I have been using TF 1.15 from original java TF repository

<dependency>
    <groupId>org.tensorflow</groupId>
    <artifactId>tensorflow</artifactId>
    <version>1.15.0</version>
</dependency>

which gave me this output:

I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2494460000 Hz
I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f77250299d0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version

so found out this repo, made environment to be able to build TF from sources, ran mvn install command which, I would assume, compiled TF on my specific platform. Using dependencies in my project:

<dependency>
    <groupId>org.tensorflow</groupId>
    <artifactId>tensorflow-core-api</artifactId>
    <version>0.2.0-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>org.tensorflow</groupId>
    <artifactId>tensorflow-core-api</artifactId>
    <version>0.2.0-SNAPSHOT</version>
    <classifier>linux-x86_64</classifier>
</dependency>

getting output:

Warning: Could not load Loader: java.lang.UnsatisfiedLinkError: no jnijavacpp in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]
Warning: Could not load Pointer: java.lang.UnsatisfiedLinkError: no jnijavacpp in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]
Warning: Could not load BytePointer: java.lang.UnsatisfiedLinkError: no jnijavacpp in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]
I external/org_tensorflow/tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Warning: Could not load PointerPointer: java.lang.UnsatisfiedLinkError: no jnijavacpp in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]

Everything somehow runs, but throughput is about the same as generic 1.15 version and latency is about 2 times worse than the previous version using the same TF model with V1 behavior enabled. Not sure how to enable AVX2 FMA instructions when TF clearly founds them. I suppose it has something to do about missing jnijavacpp library. Could anyone help me, please?

Thanks

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Không có tệp mã nguồn hoặc bài kiểm thử nào được nêu. Hãy bắt đầu bằng cách tái hiện bản build Ubuntu 20.04 với mvn install, sau đó kiểm tra các cảnh báo khi tải thư viện native và thông báo AVX2/FMA được báo cáo. Công việc được xem là hoàn tất khi xác định được lý do gói Java đã build không đạt hiệu năng như kỳ vọng, đồng thời ghi lại hoặc xác minh bản sửa bằng các phép đo throughput và độ trễ có thể so sánh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, tensorflow
Lĩnh vực
build-system, machine-learning
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
20/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.