Skip to content

Comparison of Windows Build VS Unix Build (through WSL2) #507

@BadisG

Description

@BadisG

Environment and Context

Hello,
Before jumping to the subject, here's the environnement I'm working with:

  • Windows 10
  • Llama-13b-4bit-(GPTQ quantized) model
  • Intel® Core™ i7-10700K [AVX | AVX2 | FMA | SSE3 | F16C]

Expected Behavior

I did some comparaisons between the Windows build and the Unix build (through WSL2 Ubuntu_2204.1.8.0_x64) to see if I can notice some differences between them.

Deterministic Settings (seed =1)

For both of those builds, I added the same exact settings:

-t 14 -n 2024 -c 2024 --temp 0.2 --top_k 40 --top_p 0.6 --repeat_last_n 2048 
--repeat_penalty 1.17647058824 --color --n_parts 1 -b 500 --seed 1 -p "$(cat STORY.txt)"

With the contents of STORY.txt as follows:

Here's 5 reasons that proves why video-games are good for your brain:

Test#1: Instruction set architectures

Windows:

system_info: n_threads = 14 / 16 | AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 0 | 
NEON = 0 | ARM_FMA = 0 | F16C = 0 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 0 | VSX = 0 |

WSL2

system_info: n_threads = 14 / 16 | AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 1 | 
NEON = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 1 | VSX = 0 |

The Unix-build recognizes all the architectures of my CPU but the Windows-build is missing the F16C, FMA and SSE3 one.

  • We probably haven't implemented all the CPU architectures on the Windows build (and maybe on the Unix build too)
  • My CPU has more architectures than those included into the builds [MMX, SSE, SSE2, SSSE3, SSE4, SSE4.1 + SSE4.2, AES, BMI, BMI1 + BMI2, FMA3, EM64T, HT, VT-x, VT-d]

I believe that we can significantly enhance the speed of the results by implementing all of the possible instruction set architectures that would be advantageous for text generation.

Test#2: Reproducibility of the output

Since I used the exact same settings for both the Windows and Unix builds (refer to "Deterministic Settings (seed=1)"), I should expect to obtain the exact same output from both.

Windows (I'll call this output "WindowsText"):

1. Video games improve hand eye coordination and reaction time, which is a skill used in everyday life.
2. They help you to focus on the task at hand by blocking out distractions around you. This helps with concentration when doing other tasks such as reading or writing an essay.
3. It improves problem solving skills because it requires players to think of different ways to solve problems. For example, if there was a puzzle that required you to find a key to unlock a door but the only way to get the key is to kill someone who has it then you would have to decide whether killing them is worth getting the key.
4. It can be very relaxing after a long day of school work so it gives you some down time from all the stressful things going on in your life.
5. It also increases creativity because they require you to come up with new ideas to complete levels. [end of text]

WSL2 (I'll call this output "UnixText")

1. Video games improve hand eye coordination and reaction time, which is a very important skill in sports like basketball or football where you need to react quickly when the ball comes towards you.
2. It improves problem solving skills as well because it requires players to think of different ways to solve problems. For example, if there’s an obstacle blocking your way then you have to find another route around it. This helps with real life situations too!
3. It also increases attention span by keeping kids focused on one task at a time. If they get distracted while playing a game then they won’t be able to complete their goal.
4. It can help develop social skills such as teamwork and communication. Players must work together to accomplish goals. They learn how to communicate effectively through voice chat so that everyone knows what needs to happen next.
5. Lastly, it teaches patience. Sometimes you may not know exactly what to do right away but after some practice you will eventually figure out how to beat the level. [end of text]

It's not the case at all, you will get a different output based on the fact you're using a Windows build or a Unix build.

I believe the Unix build has better outputs than the Windows one for the following reasons:

  • It mentions the importance of hand-eye coordination in sports like basketball or football, which are common activities that many people can relate to.

  • UnixText provides a more comprehensive list of benefits. It discusses the improvement of attention span, the development of social skills, and the teaching of patience, which are all valuable skills that were not mentioned in WindowsText.

  • The structure of UnixText is clearer and more concise, which makes it easier to read and understand.

Test#3: Speed

Windows:

llama_print_timings:        load time = 21085.73 ms
llama_print_timings:      sample time =   734.50 ms /   194 runs   (    3.79 ms per run)
llama_print_timings: prompt eval time =  5380.24 ms /    20 tokens (  269.01 ms per token)
llama_print_timings:        eval time = 93395.22 ms /   193 runs   (  483.91 ms per run)
llama_print_timings:       total time = 121975.58 ms

WSL2:

llama_print_timings:        load time = 30968.40 ms
llama_print_timings:      sample time =  2342.41 ms /   219 runs   (   10.70 ms per run)
llama_print_timings: prompt eval time =  4668.72 ms /    20 tokens (  233.44 ms per token)
llama_print_timings:        eval time = 96435.62 ms /   218 runs   (  442.37 ms per run)
llama_print_timings:       total time = 137830.02 ms
  1. Load time : Windows is 1.46 times faster than Unix.
  2. Sample time : Windows is 2.82 times faster than Unix.
  3. Prompt eval time: Unix is 1.15 times faster than Windows.
  4. Eval Time (Most important value) : Unix is 1.09 times faster than Windows

Unix tends to be faster than Windows, which may be due to the absence of F16C, FMA, and SSE3 architectures in the Windows build.

Conclusion

  1. The builds doesn't recognize all possible architectures on your CPU, if we fix that we could probably have significant increase of speed.
  2. Windows and WSL2 don't produce the same output, and I believe the Unix build gives better result. This is kinda concerning because the model is supposed to behave identically no matter the operating system.
  3. Unix is a bit faster than Windows, but that comparaison would be more relevant if both of them used the same architectures implementations.

I think the discrepancies between the two operating systems were not only observed by me but also by others, and efforts are underway to address them. Nonetheless, I found it interesting to witness such differences between the two systems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildCompilation issuesquestionFurther information is requestedstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions