UbiquitousLearning / mllm

Fast Multimodal LLM on Mobile Devices
https://ubiquitouslearning.github.io/mllm_website
MIT License
548 stars 61 forks source link

fix: windows compile bug #147

Closed chenghuaWang closed 2 months ago

chenghuaWang commented 2 months ago

Compiled using Clang17. Test Passed

chenghuaWang commented 2 months ago

@yirongjie Some Server dose not support AVX-VNNI(_mm256_dpbusd_avx_epi32), such as ice lake.

#if defined(__AVXVNNI__) || (defined(__AVX512VNNI__) && defined(__AVX512VL__))
        // res = _mm256_dpbusd_epi32(_mm256_setzero_si256(), u, s);
        res = _mm256_dpbusd_avx_epi32(_mm256_setzero_si256(), u, s);
#else

should be changed to

#if defined(__AVXVNNI__)
        ...
#elif  (defined(__AVX512VNNI__) && defined(__AVX512VL__))
        ...
#else

See document:

https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_dpbusd_avx_epi32&ig_expand=2683

and

https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_dpbusd_epi32&ig_expand=2688

image

image

yirongjie commented 2 months ago

@chenghuaWang I fix it here .https://github.com/UbiquitousLearning/mllm/pull/147/commits/93eac2ebde357cdcbfef9f2dddf7dad59fe0150d