How to know if avx512 in using?

09:04:36.249 [main] INFO org.nd4j.linalg.factory.Nd4jBackend – Loaded [CpuBackend] backend
09:04:36.578 [main] INFO org.nd4j.nativeblas.NativeOpsHolder – Number of threads used for linear algebra: 8
09:04:36.580 [main] INFO org.nd4j.linalg.cpu.nativecpu.CpuNDArrayFactory – Binary level AVX512 optimization level AVX512
09:04:36.583 [main] INFO org.nd4j.nativeblas.Nd4jBlas – Number of threads used for OpenMP BLAS: 8
09:04:36.589 [main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner – Backend used: [CPU]; OS: [Linux]
09:04:36.589 [main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner – Cores: [16]; Memory: [4.0GB];
09:04:36.589 [main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner – Blas vendor: [OPENBLAS]
09:04:36.591 [main] INFO org.nd4j.linalg.cpu.nativecpu.CpuBackend – Backend build information:
GCC: “7.5.0”
STD version: 201103L
DEFAULT_ENGINE: samediff::ENGINE_CPU
HAVE_FLATBUFFERS
HAVE_OPENBLAS

@Booker can you show your pom? You can’t just use nd4j-native-platform. You need to include a special classifier with the avx512 suffix.

<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<nd4j.backend>nd4j-native</nd4j.backend>
	<java.version>21</java.version>
	<dl4j.version>1.0.0-M2.1</dl4j.version>
</properties>

<repositories>
	<repository>
		<id>snapshots-repo</id>
		<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
		<releases>
			<enabled>false</enabled>
		</releases>
		<snapshots>
			<enabled>true</enabled>
			<updatePolicy>daily</updatePolicy>
		</snapshots>
	</repository>
</repositories>

<dependencies>
	<dependency>
		<groupId>org.nd4j</groupId>
		<artifactId>${nd4j.backend}</artifactId>
		<version>${dl4j.version}</version>
	</dependency>
	<dependency>
		<groupId>org.nd4j</groupId>
		<artifactId>${nd4j.backend}</artifactId>
		<version>${dl4j.version}</version>
		<classifier>linux-x86_64-avx512</classifier>
	</dependency>
	<dependency>
		<groupId>org.deeplearning4j</groupId>
		<artifactId>deeplearning4j-core</artifactId>
		<version>${dl4j.version}</version>
	</dependency>
	<dependency>
		<groupId>org.deeplearning4j</groupId>
		<artifactId>deeplearning4j-nn</artifactId>
		<version>${dl4j.version}</version>
	</dependency>
	<dependency>
		<groupId>org.deeplearning4j</groupId>
		<artifactId>deeplearning4j-ui</artifactId>
		<version>${dl4j.version}</version>
	</dependency>
	<dependency>
		<groupId>org.nd4j</groupId>
		<artifactId>samediff-import-tensorflow</artifactId>
		<version>${dl4j.version}</version>
	</dependency>
	<dependency>
		<groupId>org.nd4j</groupId>
		<artifactId>python4j-core</artifactId>
		<version>${dl4j.version}</version>
	</dependency>
	<dependency>
		<groupId>org.nd4j</groupId>
		<artifactId>python4j-numpy</artifactId>
		<version>${dl4j.version}</version>
	</dependency>

Does it need specific -D arguments like mkl etc to use avx512 and what logs should print when using avx512?

@agibsonccc Hi, how to let it work with avx512 in M2.1 or snapshot?

@Booker this looks ok. Do you have a specific issue? You just need the dependency without the classifier and the one with the avx512 suffix. Did you try it?

@agibsonccc The pom and logs shown in the last posts. How to check if avx512 in using by logs?
INFO org.nd4j.linalg.cpu.nativecpu.CpuNDArrayFactory – Binary level AVX512 optimization level AVX512 —Does this log only shown the avx512 is detected and not sure if avx512 in using?

HAVE_OPENBLAS —Why not shown HAVE_ONEDNN?