Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Redirect the build logs and output logs to different files. #1245

Open
Stonepia opened this issue Jan 6, 2025 · 2 comments
Open
Assignees

Comments

@Stonepia
Copy link
Contributor

Stonepia commented Jan 6, 2025

Since the build logs and test logs are way too long, how about we consider redirecting them to different files?

Brief Introduction

For Linux , 0 is stdin, 1 is stdout , and 2 is stderr. Please see https://phoenixnap.com/kb/bash-redirect-stderr-to-stdout for detail.
So the user could redirect the output like this:

This is an example of redirect stderr to a separate file.

python test.py 2>stderror.log

This is an example we normally redirect all output to stdout for debugging and output them to a separate file.

python test.py 2>&1 | tee all.log

For Windows, 1 is Success output, 2 is Error output. 3 is the warning. and * means all stream output. See https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_redirection?view=powershell-7.4.

Proposal

Instead of redirecting all output to stdout, we could redirect them to separate files. We only need to get the last ~200 lines of stderr when the build/test failed. That's enough for our debugging.

For example, for the following build command:

python setup.py bdist_wheel

we could direct them in the following way:

Linux:

python setup.py bdist_wheel 1> logs\stdout.log 2> logs\stderr.log

Windows

python setup.py bdist_wheel 1>.\logs\stdout.log 2>.\logs\stderr.log

The above would redirect the output to different files. Normally, we just need to check about the output from 1 and go to the error.log for details.

Please go to the Additional Context part for example output of build. For the pytest, we could also do the same.

Additional context

Example output of build

Below is an example of an unsuccessful build. The stdout.log is 3037 lines, and stderr.log is 39166 lines, but actually, we need only about the last 100 lines of the stderr.log. You could find that the error is because the device does not have enough space, that's all we need.

stdout.log:

[ 55%] Built target generatorXELP
Compilation from IR - skipping loading of FCL

warning: kernel _ZTS17fused_residual_lnIN4sycl3_V13ext6oneapi8bfloat16ELi8ELi256ELi256ELb0EE  compiled SIMD32 allocated 128 regs and spilled around 4

warning: kernel _ZTS17fused_residual_lnIN4sycl3_V13ext6oneapi8bfloat16ELi8ELi256ELi256ELb1EE  compiled SIMD32 allocated 128 regs and spilled around 8

Build succeeded.
Compilation from IR - skipping loading of FCL
Build succeeded.
[ 55%] Built target generatorXEHPG
Compilation from IR - skipping loading of FCL
Build succeeded.
[ 55%] Built target generatorXE3
[ 59%] Built target dnnl_common
[ 65%] Built target dnnl_gpu_intel_jit
[ 72%] Built target dnnl_cpu
Compilation from IR - skipping loading of FCL
Build succeeded.
[ 74%] Built target intel-ext-pt-gpu-deepspeed
[ 75%] Linking CXX shared library libxetla_gemm.so
[ 83%] Built target dnnl_cpu_x64
[ 83%] Linking CXX static library libdnnl.a
[ 83%] Built target dnnl

[EOF]  <-------- You can see this is not build successfully, it failed.

stderr.log

In file included from /home/pt-gpu/4T-4652/usr/client_test/pytorch/csrc/gpu/aten/operators/xetla/kernels/GEMM/../../kernels/include/common/core/./common.hpp:22:
/home/pt-gpu/intel/oneapi/2025.0/include/sycl/CL/sycl.hpp:14:2: warning: "CL/sycl.hpp is deprecated, use sycl/sycl.hpp" [-W#warnings]
   14 | #warning "CL/sycl.hpp is deprecated, use sycl/sycl.hpp"
      |  ^
202 warnings generated.
1 warning generated.
1 warning generated.
1 warning generated.

LLVM ERROR: IO failure on output stream: No space left on device
icpx: error: sycl-link command failed with exit code 1 (use -v to see invocation)


Traceback (most recent call last):
  File "/home/pt-gpu/4T-4652/usr/client_test/pytorch/setup.py", line 1219, in <module>
    setup(
  File "/home/pt-gpu/4T-4652/envs/usr_/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
  File "/home/pt-gpu/4T-4652/envs/usr_/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-j', '224', 'install']' returned non-zero exit status 2.
@Stonepia
Copy link
Contributor Author

Stonepia commented Jan 6, 2025

$env:CL="/D_CRT_SECURE_NO_WARNINGS" could also help to reduce warnings in Windows

@Stonepia
Copy link
Contributor Author

Stonepia commented Jan 6, 2025

related PR: #1181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants