Issue 1:
Solved 🎉

Starting from v1.10.0, torch.nn.CrossEntropy()has an arg label_smoothing=0.0 - API link.

Hi, guys. The type torch.LongTensor of target will hinder the implementation like some methods in reference. So is there a possible to add a Arg: label_smoothing for torch.nn.CrossEntropyLoss(), or maybe simply add the docs to show how to convert the target into one-hot vector to work with torch.nn.CrossEntropyLoss() together, or any other simple ways? Thanks.

cc @ezyang @gchanan @zou3519 @bdhirsh @albanD @mruberry

Issue 2:
🐛 Bug

building from source fails with:

Building wheel torch-1.1.0a0+f5165ad
-- Building version 1.1.0a0+f5165ad
['cmake',
'-DBUILDING_WITH_TORCH_LIBS=ON',
'-DBUILD_BINARY=False',
'-DBUILD_CAFFE2_OPS=True',
'-DBUILD_PYTHON=True',
'-DBUILD_SHARED_LIBS=ON',
'-DBUILD_TEST=True',
'-DBUILD_TORCH=ON',
'-DCAFFE2_STATIC_LINK_CUDA=False',
'-DCMAKE_BUILD_TYPE=Release',
'-DCMAKE_CXX_FLAGS= ',
'-DCMAKE_C_FLAGS= ',
'-DCMAKE_EXE_LINKER_FLAGS=',
'-DCMAKE_INSTALL_PREFIX=/home/msl/isaac/pytorch/torch',
'-DCMAKE_PREFIX_PATH=/home/msl/anaconda3/envs/pytorch',
'-DCMAKE_SHARED_LINKER_FLAGS=',
'-DINSTALL_TEST=True',
'-DNCCL_EXTERNAL=True',
'-DNUMPY_INCLUDE_DIR=/home/msl/anaconda3/envs/pytorch/lib/python3.6/site-packages/numpy/core/include',
'-DONNX_ML=False',
'-DONNX_NAMESPACE=onnx_torch',
'-DPYTHON_EXECUTABLE=/home/msl/anaconda3/envs/pytorch/bin/python',
'-DPYTHON_INCLUDE_DIR=/home/msl/anaconda3/envs/pytorch/include/python3.6m',
'-DPYTHON_LIBRARY=/home/msl/anaconda3/envs/pytorch/lib/libpython3.6m.so.1.0',
'-DTHD_SO_VERSION=1',
'-DTORCH_BUILD_VERSION=1.1.0a0+f5165ad',
'-DUSE_CUDA=True',
'-DUSE_DISTRIBUTED=True',
'-DUSE_FBGEMM=True',
'-DUSE_FFMPEG=False',
'-DUSE_LEVELDB=False',
'-DUSE_LMDB=False',
'-DUSE_MKLDNN=True',
'-DUSE_NCCL=True',
'-DUSE_NNPACK=True',
'-DUSE_NUMPY=True',
'-DUSE_OPENCV=False',
'-DUSE_QNNPACK=True',
'-DUSE_ROCM=False',
'-DUSE_SYSTEM_EIGEN_INSTALL=OFF',
'-DUSE_SYSTEM_NCCL=False',
'-DUSE_TENSORRT=False',
'-DMKLDNN_ENABLE_CONCURRENT_EXEC=ON',
'/home/msl/isaac/pytorch']
-- The CXX compiler identification is GNU 5.3.0
-- The C compiler identification is GNU 5.3.0
-- Check for working CXX compiler: /usr/local/bin/c++
-- Check for working CXX compiler: /usr/local/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/local/bin/gcc
-- Check for working C compiler: /usr/local/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Not forcing any particular BLAS to be found
-- Performing Test COMPILER_WORKS
-- Performing Test COMPILER_WORKS - Success
-- Performing Test SUPPORT_GLIBCXX_USE_C99
-- Performing Test SUPPORT_GLIBCXX_USE_C99 - Success
-- Performing Test CAFFE2_EXCEPTION_PTR_SUPPORTED
-- Performing Test CAFFE2_EXCEPTION_PTR_SUPPORTED - Success
-- std::exception_ptr is supported.
-- Performing Test CAFFE2_IS_NUMA_AVAILABLE
-- Performing Test CAFFE2_IS_NUMA_AVAILABLE - Failed
-- NUMA is not available
-- Performing Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING
-- Performing Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING - Failed
-- Turning off deprecation warning due to glog.
-- Performing Test CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS
-- Performing Test CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS - Success
-- Current compiler supports avx2 extension. Will build perfkernels.
-- Performing Test CAFFE2_COMPILER_SUPPORTS_AVX512_EXTENSIONS
-- Performing Test CAFFE2_COMPILER_SUPPORTS_AVX512_EXTENSIONS - Success
-- Current compiler supports avx512f extension. Will build fbgemm.
-- Performing Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_SUPPORTS_RDYNAMIC
-- Performing Test COMPILER_SUPPORTS_RDYNAMIC - Success
-- Building using own protobuf under third_party per request.
-- Use custom protobuf build.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Caffe2 protobuf include directory: $<BUILD_INTERFACE:/home/msl/isaac/pytorch/third_party/protobuf/src>$<INSTALL_INTERFACE:include>
-- Trying to find preferred BLAS backend of choice: MKL
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
-- Looking for cblas_sgemm
-- Looking for cblas_sgemm - found
-- MKL libraries: /home/msl/anaconda3/envs/pytorch/lib/libmkl_intel_lp64.so;/home/msl/anaconda3/envs/pytorch/lib/libmkl_gnu_thread.so;/home/msl/anaconda3/envs/pytorch/lib/libmkl_core.so;-fopenmp;/usr/lib64/libpthread.so;/usr/lib64/libm.so;/usr/lib64/libdl.so
-- MKL include directory: /home/msl/anaconda3/envs/pytorch/include
-- MKL OpenMP type: GNU
-- MKL OpenMP library: -fopenmp
-- The ASM compiler identification is GNU
-- Found assembler: /usr/local/bin/gcc
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Brace yourself, we are building NNPACK
-- Performing Test NNPACK_ARCH_IS_X86_32
-- Performing Test NNPACK_ARCH_IS_X86_32 - Failed
-- Found PythonInterp: /home/msl/anaconda3/envs/pytorch/bin/python (found version "3.6.8")
-- NNPACK backend is x86-64
-- Failed to find LLVM FileCheck
-- Found Git: /usr/bin/git (found version "1.8.3.1")
-- git Version: v1.4.0-505be96a
-- Version: 1.4.0
-- Performing Test HAVE_CXX_FLAG_STD_CXX11
-- Performing Test HAVE_CXX_FLAG_STD_CXX11 - Success
-- Performing Test HAVE_CXX_FLAG_WALL
-- Performing Test HAVE_CXX_FLAG_WALL - Success
-- Performing Test HAVE_CXX_FLAG_WEXTRA
-- Performing Test HAVE_CXX_FLAG_WEXTRA - Success
-- Performing Test HAVE_CXX_FLAG_WSHADOW
-- Performing Test HAVE_CXX_FLAG_WSHADOW - Success
-- Performing Test HAVE_CXX_FLAG_WERROR
-- Performing Test HAVE_CXX_FLAG_WERROR - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC
-- Performing Test HAVE_CXX_FLAG_PEDANTIC - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL - Success
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS - Success
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WD654
-- Performing Test HAVE_CXX_FLAG_WD654 - Failed
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed
-- Performing Test HAVE_CXX_FLAG_COVERAGE
-- Performing Test HAVE_CXX_FLAG_COVERAGE - Success
-- Performing Test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX -- compiled but failed to run
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- compiled but failed to run
CMake Error at third_party/benchmark/CMakeLists.txt:231 (message):
Failed to determine the source files for the regular expression backend

-- Configuring incomplete, errors occurred!
See also "/home/msl/isaac/pytorch/build/CMakeFiles/CMakeOutput.log".
See also "/home/msl/isaac/pytorch/build/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "setup.py", line 719, in <module>
build_deps()
File "setup.py", line 285, in build_deps
build_dir='build')
File "/home/msl/isaac/pytorch/tools/build_pytorch_libs.py", line 259, in build_caffe2
my_env)
File "/home/msl/isaac/pytorch/tools/build_pytorch_libs.py", line 239, in run_cmake
check_call(cmake_args, cwd=build_dir, env=my_env)
File "/home/msl/anaconda3/envs/pytorch/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '-DBUILDING_WITH_TORCH_LIBS=ON', '-DBUILD_BINARY=False', '-DBUILD_CAFFE2_OPS=True', '-DBUILD_PYTHON=True', '-DBUILD_SHARED_LIBS=ON', '-DBUILD_TEST=True', '-DBUILD_TORCH=ON', '-DCAFFE2_STATIC_LINK_CUDA=False', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_CXX_FLAGS= ', '-DCMAKE_C_FLAGS= ', '-DCMAKE_EXE_LINKER_FLAGS=', '-DCMAKE_INSTALL_PREFIX=/home/msl/isaac/pytorch/torch', '-DCMAKE_PREFIX_PATH=/home/msl/anaconda3/envs/pytorch', '-DCMAKE_SHARED_LINKER_FLAGS=', '-DINSTALL_TEST=True', '-DNCCL_EXTERNAL=True', '-DNUMPY_INCLUDE_DIR=/home/msl/anaconda3/envs/pytorch/lib/python3.6/site-packages/numpy/core/include', '-DONNX_ML=False', '-DONNX_NAMESPACE=onnx_torch', '-DPYTHON_EXECUTABLE=/home/msl/anaconda3/envs/pytorch/bin/python', '-DPYTHON_INCLUDE_DIR=/home/msl/anaconda3/envs/pytorch/include/python3.6m', '-DPYTHON_LIBRARY=/home/msl/anaconda3/envs/pytorch/lib/libpython3.6m.so.1.0', '-DTHD_SO_VERSION=1', '-DTORCH_BUILD_VERSION=1.1.0a0+f5165ad', '-DUSE_CUDA=True', '-DUSE_DISTRIBUTED=True', '-DUSE_FBGEMM=True', '-DUSE_FFMPEG=False', '-DUSE_LEVELDB=False', '-DUSE_LMDB=False', '-DUSE_MKLDNN=True', '-DUSE_NCCL=True', '-DUSE_NNPACK=True', '-DUSE_NUMPY=True', '-DUSE_OPENCV=False', '-DUSE_QNNPACK=True', '-DUSE_ROCM=False', '-DUSE_SYSTEM_EIGEN_INSTALL=OFF', '-DUSE_SYSTEM_NCCL=False', '-DUSE_TENSORRT=False', '-DMKLDNN_ENABLE_CONCURRENT_EXEC=ON', '/home/msl/isaac/pytorch']' returned non-zero exit status 1.

To Reproduce

Steps to reproduce the behavior:

follow the guide on Github on how to build from source

run python setup.py install

Expected behavior

for it to install.

Environment

Please copy and paste the output from our

environment collection script

(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py

Collecting environment information...

PyTorch version: N/A

Is debug build: N/A

CUDA used to build PyTorch: N/A

OS: CentOS Linux 7 (Core)

GCC version: (GCC) 5.3.0

CMake version: version 3.14.0

Python version: 3.6

Is CUDA available: N/A

CUDA runtime version: 10.0.130

GPU models and configuration:

GPU 0: GeForce GTX 1080

GPU 1: GeForce GTX 1080

Nvidia driver version: 410.79

cuDNN version: Probably one of the following:

/usr/local/cuda-10.0/targets/x86_64-linux/lib/libcudnn.so.7

/usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.5

/usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7

Versions of relevant libraries:

[pip] numpy==1.16.2

[conda] blas 1.0 mkl

[conda] magma-cuda100 2.5.0 1 pytorch

[conda] mkl 2019.3 199

[conda] mkl-include 2019.3 199

[conda] mkl_fft 1.0.10 py36ha843d7b_0

[conda] mkl_random 1.0.2 py36hd81dba3_0

Additional context

I have followed the solution mentioned by @alejo9719 in this issue by updating cmake and deleteing build repo from pytorch, but error still persists

I am not sure why Is CUDA available is N/A when I run the script to collect environment info. I have /usr/local/cuda symblinked to /usr/local/cuda10.0