rmuir commented on PR #12311:
URL: https://github.com/apache/lucene/pull/12311#issuecomment-1560207056

   This isn't a theoretical issue, I really think its a openjdk problem?
   
   To reproduce it, i simply emulate a Nehalem cpu (the one right before AVX):
   ```
   processor    : 3
   vendor_id    : GenuineIntel
   cpu family   : 6
   model                : 26
   model name   : Intel Core i7 9xx (Nehalem Class Core i7)
   stepping     : 3
   microcode    : 0x1
   cpu MHz              : 2496.002
   cache size   : 16384 KB
   physical id  : 0
   siblings     : 4
   core id              : 1
   cpu cores    : 2
   apicid               : 3
   initial apicid       : 3
   fpu          : yes
   fpu_exception        : yes
   cpuid level  : 11
   wp           : yes
   flags                : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge 
mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc 
rep_good nopl xtopology cpuid tsc_known_freq pni ssse3 cx16 sse4_1 sse4_2 
x2apic popcnt hypervisor lahf_lm cpuid_fault
   bugs         : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds 
swapgs itlb_multihit mmio_unknown
   bogomips     : 4994.00
   clflush size : 64
   cache_alignment      : 64
   address sizes        : 40 bits physical, 48 bits virtual
   power management:
   ```
   
   Here's my QEMU command:
   ```
   qemu-system-x86_64 \
     -name "Arch Linux" \
     -machine q35,vmport=off \
     -accel kvm,kernel-irqchip=on \
     -cpu Nehalem-v1 \
     -smp 4,cores=2,threads=2 \
     -m 8192 \
     -boot menu=on \
     -nodefaults \
     -no-user-config \
     -object rng-random,id=rng0,filename=/dev/urandom -device 
virtio-rng-pci,rng=rng0 \
     -nic user,ipv6=off,model=virtio-net-pci,hostfwd=tcp::10022-:22 \
     -device virtio-scsi-pci,id=scsi0 \
     -device scsi-hd,bus=scsi0.0,drive=drive-scsi0 \
     -drive file=disk.qcow2,if=none,id=drive-scsi0,discard=on \
     -nographic \
     -vga none \
     -device virtio-serial-pci \
     -device virtserialport \
     -device virtconsole \
     -serial mon:stdio \
     -parallel none
   ```
   
   Here are benchmark results. It behaves the same as passing `-XX:UseAVX=0` on 
the host machine.
   ```
   Benchmark                                (size)   Mode  Cnt  Score   Error   
Units
   BinaryCosineBenchmark.cosineDistanceNew    1024  thrpt    5  0.010 ± 0.003  
ops/us
   BinaryCosineBenchmark.cosineDistanceOld    1024  thrpt    5  0.776 ± 0.107  
ops/us
   BinaryDotProductBenchmark.dotProductNew    1024  thrpt    5  0.023 ± 0.006  
ops/us
   BinaryDotProductBenchmark.dotProductOld    1024  thrpt    5  1.861 ± 0.087  
ops/us
   BinarySquareBenchmark.squareDistanceNew    1024  thrpt    5  0.025 ± 0.001  
ops/us
   BinarySquareBenchmark.squareDistanceOld    1024  thrpt    5  1.555 ± 0.048  
ops/us
   FloatCosineBenchmark.cosineNew             1024  thrpt    5  3.416 ± 0.256  
ops/us
   FloatCosineBenchmark.cosineOld             1024  thrpt    5  0.694 ± 0.117  
ops/us
   FloatDotProductBenchmark.dotProductNew     1024  thrpt    5  8.968 ± 0.125  
ops/us
   FloatDotProductBenchmark.dotProductOld     1024  thrpt    5  1.835 ± 0.162  
ops/us
   FloatSquareBenchmark.squareNew             1024  thrpt    5  6.665 ± 0.068  
ops/us
   FloatSquareBenchmark.squareOld             1024  thrpt    5  1.224 ± 0.151  
ops/us
   ```
   
   ```
   dev0:vectorbench[main]$ /usr/lib/jvm/java-20-openjdk/bin/jshell 
--add-modules jdk.incubator.vector
   May 23, 2023 6:24:14 PM java.util.prefs.FileSystemPreferences$1 run
   INFO: Created user preferences directory.
   |  Welcome to JShell -- Version 20.0.1
   |  For an introduction type: /help intro
   
   jshell> jdk.incubator.vector.IntVector.SPECIES_PREFERRED
   $1 ==> Species[int, 4, S_128_BIT]
   ```
   
   128-bit vectors are claimed but don't work. This is not good.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to