Fast-LLM icon indicating copy to clipboard operation
Fast-LLM copied to clipboard

[bug] 16 unit tests fail on main with custom install

Open bigximik opened this issue 11 months ago • 6 comments

🐞 Describe the Bug

The following tests fail on main branch

FAILED tests/data/test_sampling.py::test_gpt_sample[full-0] - AssertionError: 3 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[full-32] - AssertionError: 1 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[full-88] - AssertionError: 3 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[epoch-0] - AssertionError: 3 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[epoch-32] - AssertionError: 1 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[epoch-88] - AssertionError: 3 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[skip_first_epoch-0] - AssertionError: 4 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[skip_first_epoch-32] - AssertionError: 4 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[skip_first_epoch-88] - AssertionError: 4 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[disabled-0] - AssertionError: 4 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[disabled-32] - AssertionError: 4 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[disabled-88] - AssertionError: 4 != 6
FAILED tests/test_match_megatron.py::test_gpt2_meg - RuntimeError: Process failed with return code 1
FAILED tests/test_match_megatron.py::test_mistral_meg - RuntimeError: Process failed with return code 1
FAILED tests/test_match_megatron.py::test_mixtral_meg - RuntimeError: Process failed with return code 1
FAILED tests/test_simple.py::test_model - RuntimeError: DataLoader worker (pid(s) 16376) exited unexpectedly

🔄 Steps to Reproduce

Steps to reproduce the behavior:

  1. commit id fae01025acf59275d215c5d0fea821c484083889

  2. Run from research interactive job: registry.toolkit-sp.yul201.service-now.com/snow.shared/interactive-toolkit:latest

  3. conda environment pip freeze:

      aiohappyeyeballs==2.4.6
     aiohttp==3.11.13
     aiosignal==1.3.2
     annotated-types==0.7.0
     antlr4-python3-runtime==4.9.3
     apex @ file:///home/toolkit/code/apex
     asttokens @ file:///home/conda/feedstock_root/build_artifacts/asttokens_1733250440834/work
     attrs==25.1.0
     Brotli @ file:///croot/brotli-split_1736182456865/work
     certifi @ file:///home/conda/feedstock_root/build_artifacts/certifi_1739515848642/work/certifi
     cfgv==3.4.0
     charset-normalizer @ file:///croot/charset-normalizer_1721748349566/work
     click==8.1.8
     colorama==0.4.6
     comm @ file:///home/conda/feedstock_root/build_artifacts/comm_1733502965406/work
     datasets==3.3.2
     debugpy @ file:///croot/debugpy_1736267418885/work
     decorator @ file:///home/conda/feedstock_root/build_artifacts/decorator_1740384970518/work
     dill==0.3.8
     distlib==0.3.9
     docker-pycreds==0.4.0
     einops==0.8.1
     exceptiongroup @ file:///home/conda/feedstock_root/build_artifacts/exceptiongroup_1733208806608/work
     executing @ file:///home/conda/feedstock_root/build_artifacts/executing_1733569351617/work
     -e git+ssh://[email protected]/ServiceNow/Fast-LLM.git@fae01025acf59275d215c5d0fea821c484083889#egg=fast_llm
     filelock @ file:///work/perseverance-python-buildout/croot/filelock_1701733993137/work
     flash-attn==2.7.2.post1
     frozenlist==1.5.0
     fsspec==2024.12.0
     future-fstrings==1.2.0
     gitdb==4.0.12
     GitPython==3.1.44
     gmpy2 @ file:///croot/gmpy2_1738085463648/work
     hf_transfer==0.1.9
     huggingface-hub==0.29.1
     hydra-core==1.3.2
     identify==2.6.8
     idna==3.10
     importlib_metadata @ file:///home/conda/feedstock_root/build_artifacts/importlib-metadata_1737420181517/work
     iniconfig==2.0.0
     ipykernel @ file:///home/conda/feedstock_root/build_artifacts/ipykernel_1719845459717/work
     ipython @ file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_ipython_1741457126/work
     ipython_pygments_lexers @ file:///home/conda/feedstock_root/build_artifacts/ipython_pygments_lexers_1737123620466/work
     jedi @ file:///home/conda/feedstock_root/build_artifacts/jedi_1733300866624/work
     Jinja2 @ file:///croot/jinja2_1737760107953/work
     jupyter_client @ file:///home/conda/feedstock_root/build_artifacts/jupyter_client_1733440914442/work
     jupyter_core @ file:///home/conda/feedstock_root/build_artifacts/jupyter_core_1727163409502/work
     MarkupSafe @ file:///croot/markupsafe_1738584038848/work
     matplotlib-inline @ file:///home/conda/feedstock_root/build_artifacts/matplotlib-inline_1733416936468/work
     mkl-service==2.4.0
     mkl_fft @ file:///io/mkl313/mkl_fft_1730824109137/work
     mkl_random @ file:///io/mkl313/mkl_random_1730823916628/work
     mpmath @ file:///work/perseverance-python-buildout/croot/mpmath_1698864994882/work
     multidict==6.1.0
     multiprocess==0.70.16
     nest_asyncio @ file:///home/conda/feedstock_root/build_artifacts/nest-asyncio_1733325553580/work
     networkx @ file:///croot/networkx_1737039604450/work
     nodeenv==1.9.1
     numpy==1.26.4
     nvidia-cublas-cu12==12.4.5.8
     nvidia-cuda-cupti-cu12==12.4.127
     nvidia-cuda-nvrtc-cu12==12.4.127
     nvidia-cuda-runtime-cu12==12.4.127
     nvidia-cudnn-cu12==9.1.0.70
     nvidia-cufft-cu12==11.2.1.3
     nvidia-curand-cu12==10.3.5.147
     nvidia-cusolver-cu12==11.6.1.9
     nvidia-cusparse-cu12==12.3.1.170
     nvidia-cusparselt-cu12==0.6.2
     nvidia-nccl-cu12==2.21.5
     nvidia-nvjitlink-cu12==12.4.127
     nvidia-nvtx-cu12==12.4.127
     omegaconf==2.3.0
     packaging @ file:///home/conda/feedstock_root/build_artifacts/packaging_1733203243479/work
     pandas==2.2.3
     parso @ file:///home/conda/feedstock_root/build_artifacts/parso_1733271261340/work
     pexpect @ file:///home/conda/feedstock_root/build_artifacts/pexpect_1733301927746/work
     pickleshare @ file:///home/conda/feedstock_root/build_artifacts/pickleshare_1733327343728/work
     pillow @ file:///croot/pillow_1738010226202/work
     platformdirs @ file:///home/conda/feedstock_root/build_artifacts/platformdirs_1733232627818/work
     pluggy==1.5.0
     pre_commit==4.1.0
     prompt_toolkit @ file:///home/conda/feedstock_root/build_artifacts/prompt-toolkit_1737453357274/work
     propcache==0.3.0
     protobuf==5.29.3
     psutil @ file:///croot/psutil_1736367091698/work
     ptyprocess @ file:///home/conda/feedstock_root/build_artifacts/ptyprocess_1733302279685/work/dist/ptyprocess-0.7.0-py2.py3-none-any.whl#sha256=92c32ff62b5fd8cf325bec5ab90d7be3d2a8ca8c8a3813ff487a8d2002630d1f
     pure_eval @ file:///home/conda/feedstock_root/build_artifacts/pure_eval_1733569405015/work
     pyarrow==19.0.1
     pybind11==2.13.6
     pydantic==2.10.6
     pydantic_core==2.27.2
     Pygments @ file:///home/conda/feedstock_root/build_artifacts/pygments_1736243443484/work
     PySocks @ file:///work/perseverance-python-buildout/croot/pysocks_1698845478203/work
     pytest==8.3.4
     pytest-depends==1.0.1
     python-dateutil @ file:///home/conda/feedstock_root/build_artifacts/python-dateutil_1733215673016/work
     pytz==2025.1
     PyYAML @ file:///croot/pyyaml_1728657952215/work
     pyzmq @ file:///croot/pyzmq_1734687138743/work
     regex==2024.11.6
     requests @ file:///croot/requests_1730999120400/work
     safetensors==0.5.3
     sentry-sdk==2.22.0
     setproctitle==1.3.5
     setuptools==75.8.0
     six @ file:///home/conda/feedstock_root/build_artifacts/six_1733380938961/work
     smmap==5.0.2
     stack_data @ file:///home/conda/feedstock_root/build_artifacts/stack_data_1733569443808/work
     sympy==1.13.1
     tokenizers==0.21.0
     torch==2.5.1
     torchaudio==2.5.1
     torchvision==0.20.1
     tornado @ file:///croot/tornado_1733960490606/work
     tqdm==4.67.1
     traitlets @ file:///home/conda/feedstock_root/build_artifacts/traitlets_1733367359838/work
     transformers==4.49.0
     triton==3.1.0
     typing_extensions @ file:///croot/typing_extensions_1734714854207/work
     tzdata==2025.1
     urllib3 @ file:///croot/urllib3_1737133630106/work
     virtualenv==20.29.2
     wandb==0.19.7
     wcwidth @ file:///home/conda/feedstock_root/build_artifacts/wcwidth_1733231326287/work
     wheel==0.45.1
     xxhash==3.5.0
     yarl==1.18.3
     zipp @ file:///home/conda/feedstock_root/build_artifacts/zipp_1732827521216/work
    
  4. run pytest tests

🎯 Expected Behavior

pass all the tests

📜 Environment Information

Run the following script in your environment and paste its output here:

=== SYSTEM INFORMATION ===
Operating System:
Linux 322263a3-2a65-48b1-ab24-68fe587efa77 5.15.0-1067-nvidia #68-Ubuntu SMP Mon Oct 7 14:34:20 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
CPU Information:
Architecture:             x86_64
  CPU op-mode(s):         32-bit, 64-bit
  Address sizes:          52 bits physical, 57 bits virtual
  Byte Order:             Little Endian
CPU(s):                   224
  On-line CPU(s) list:    0-223
Vendor ID:                GenuineIntel
  Model name:             Intel(R) Xeon(R) Platinum 8480C
    CPU family:           6
    Model:                143
    Thread(s) per core:   2
    Core(s) per socket:   56
    Socket(s):            2
    Stepping:             8
    CPU(s) scaling MHz:   96%
    CPU max MHz:          3800.0000
    CPU min MHz:          800.0000
    BogoMIPS:             4000.00
    Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfm
                          perf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_
                          l3 cat_l2 cdp_l3 invpcid_single intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512
                          ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hwp hwp_act_window 
                          hwp_epp hwp_pkg_req avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig
                           arch_lbr amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities
Virtualization features:  
  Virtualization:         VT-x
Caches (sum of all):      
  L1d:                    5.3 MiB (112 instances)
  L1i:                    3.5 MiB (112 instances)
  L2:                     224 MiB (112 instances)
  L3:                     210 MiB (2 instances)
NUMA:                     
  NUMA node(s):           2
  NUMA node0 CPU(s):      0-55,112-167
  NUMA node1 CPU(s):      56-111,168-223
Vulnerabilities:          
  Gather data sampling:   Not affected
  Itlb multihit:          Not affected
  L1tf:                   Not affected
  Mds:                    Not affected
  Meltdown:               Not affected
  Mmio stale data:        Not affected
  Reg file data sampling: Not affected
  Retbleed:               Not affected
  Spec rstack overflow:   Not affected
  Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl and seccomp
  Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:             Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
  Srbds:                  Not affected
  Tsx async abort:        Not affected
Memory Information:
               total        used        free      shared  buff/cache   available
Mem:           2.0Ti       120Gi       273Gi       361Mi       1.6Ti       1.9Ti
Swap:             0B          0B          0B
=== GPU INFORMATION ===
NVIDIA System Management Interface (nvidia-smi):
Thu Mar 20 20:59:01 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.127.05             Driver Version: 550.127.05     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA H100 80GB HBM3          On  |   00000000:52:00.0 Off |                    0 |
| N/A   32C    P0             69W /  700W |       1MiB /  81559MiB |      0%      Default |
|                                         |                        |             Disabled |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
CUDA Version:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Wed_Jan_15_19:20:09_PST_2025
Cuda compilation tools, release 12.8, V12.8.61
Build cuda_12.8.r12.8/compiler.35404655_0
=== PYTHON AND TORCH INFORMATION ===
Python Version:
Python 3.12.9
Torch Version:
2.5.1
CUDA Available (in Torch):
True
CUDA Version (in Torch):
12.1
NCCL Version (in Torch):
(2, 21, 5)
=== FLASH ATTENTION INFORMATION ===
Flash Attention Version:
2.7.2.post1
=== APEX INFORMATION ===
APEX Version:
APEX version not specified
=== END OF ENVIRONMENT INFORMATION ===

📝 Additional Context

full output of the tests attached

log.txt

bigximik avatar Mar 20 '25 21:03 bigximik

I'm not sure about the sampling errors, but test_match_megatron and test_model point to environment issues (missing transformer engine, problem with numpy). You're using a custom fast-llm installation right? Any reason for not using the official Fast-LLM image?

Concerning the data thing, one possibility is that the test cache got corrupted, try rm -r/tmp/fast_llm_tests first (it this a long-lived job?)

jlamypoirier avatar Mar 20 '25 21:03 jlamypoirier

Unfortunately, clearing the test cache did not help, and the same tests are still failing.

Regarding why I’m not using the official image—I am using the interactive job as a workstation and working within it. In my workflow, it is easier to create a Python environment with the required dependencies and run tests there. This allows me to use all my usual tools, such as remote Visual Studio Code, to make real-time code changes and debug the code.

I believe I’m not the only one using this workflow instead of the official image for library development. So, it would be helpful to have instructions on how to install the correct versions of dependencies, such as the mentioned NumPy and Transformer Engine.

Though we do not need to support custom installations for deployment.

Thanks.

bigximik avatar Mar 24 '25 13:03 bigximik

@jlamypoirier if this is truly due to missing dependencies then why aren't these specified as such in setup.cfg?

tscholak avatar Mar 24 '25 22:03 tscholak

@bigximik can you try https://github.com/NVIDIA/TransformerEngine?tab=readme-ov-file#pip please?

tscholak avatar Mar 24 '25 22:03 tscholak

Installing transformer engine solved 3 out of 16 failed tests but sampling and simple tests (data loader failing) still fail:

FAILED tests/data/test_sampling.py::test_gpt_sample[full-0] - AssertionError: 3 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[full-32] - AssertionError: 1 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[full-88] - AssertionError: 3 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[epoch-0] - AssertionError: 3 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[epoch-32] - AssertionError: 1 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[epoch-88] - AssertionError: 3 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[skip_first_epoch-0] - AssertionError: 4 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[skip_first_epoch-32] - AssertionError: 4 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[skip_first_epoch-88] - AssertionError: 4 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[disabled-0] - AssertionError: 4 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[disabled-32] - AssertionError: 4 != 6
FAILED tests/data/test_sampling.py::test_gpt_sample[disabled-88] - AssertionError: 4 != 6
FAILED tests/test_simple.py::test_model - RuntimeError: DataLoader worker (pid(s) 21518, 21519) exited unexpectedly

bigximik avatar Mar 25 '25 16:03 bigximik

@bigximik Is this still happening?

jlamypoirier avatar Jul 16 '25 21:07 jlamypoirier