jiebi/CodeConvo huggingface dataset:
Code change:
Looking at the values returned from tn.multinomial(1) and counting them, it seems like it returns the values of the multinomial distribution taken from t, i.e. that it has ignored the signs of the values. However, it seem like always returns a tensor filled with zeros.
looking into this

Related discussion:
text: { /* Get normalized cumulative distribution from prob distribution */ double sum = 0; <ins> double val; </ins> for (j=0; j<n_categories; j++) { <del> sum += THStorage_(get)(  </del> <ins> val = THStorage_(get)(  </ins> prob_dist->storage,  prob_dist->storageOffset+i*prob_dist->stride[0]+j*prob_dist->stride[1]  ); <ins> THArgCheckWithCleanup((val >= 0), THCleanup(THDoubleTensor_free(cum_dist); if (start_dim == 1) THTensor_(resize1d)(prob_dist, n_categories);), 2, "invalid multinomial distribution (encountering probability entry < 0)"); sum += val; </ins> THDoubleStorage_set( cum_dist->storage,  cum_dist->storageOffset+j*cum_dist->stride[0],
Code change:
Looking at the values returned from tn.multinomial(1) and counting them, it seems like it returns the values of the multinomial distribution taken from t, i.e. that it has ignored the signs of the values. However, it seem like always returns a tensor filled with zeros.
looking into this

Related discussion:
text: T bern_uniform = bernoulli[idx]; int _mask = (int) THCNumerics<T>::lt(bern_uniform, q[rand_ind]); output[idx] = J[rand_ind]*(1 -_mask) + (rand_ind+1L) * _mask; <del> } </del> <ins> } </ins> } template <typename T>
Code change:
Looking at the values returned from tn.multinomial(1) and counting them, it seems like it returns the values of the multinomial distribution taken from t, i.e. that it has ignored the signs of the values. However, it seem like always returns a tensor filled with zeros.
looking into this

Related discussion:
text: __global__ void renormRowsL1(T* dist, long rows, long cols) { extern __shared__  unsigned char my_smem[]; T *smem = reinterpret_cast<T *>(my_smem); <ins> T zero = ScalarConvert<int, T>::to(0); T val; </ins> for (int64_t row = blockIdx.x; row < rows; row += gridDim.x) { T sum = ScalarConvert<int, T>::to(0); for (int64_t col = threadIdx.x; col < cols; col += blockDim.x) { <del> sum = THCNumerics<T>::add(sum, dist[row * cols + col]); </del> <ins> val = dist[row * cols + col]; assert(THCNumerics<T>::ge(val, zero)); sum = THCNumerics<T>::add(sum, val); </ins> } <del> sum = reduceBlock(smem, blockDim.x, sum, ReduceAdd<T, T>(), ScalarConvert<int, T>::to(0)); </del> <ins> sum = reduceBlock(smem, blockDim.x, sum, ReduceAdd<T, T>(), zero); </ins> if (threadIdx.x == 0) { <ins> assert(THCNumerics<T>::gt(sum, zero)); </ins> smem[0] = sum; } __syncthreads();
Code change:
Looking at the values returned from tn.multinomial(1) and counting them, it seems like it returns the values of the multinomial distribution taken from t, i.e. that it has ignored the signs of the values. However, it seem like always returns a tensor filled with zeros.
looking into this

Related discussion:
text: // Each block handles one distribution // First pass, find the total sum of the distribution AccT sum = accZero; <ins> T val; </ins> for (int cat = threadIdx.x; cat < categories; cat += blockDim.x) { <del> sum = THCNumerics<AccT>::add( sum, ScalarConvert<T, AccT>::to(dist[curDist * categories + cat])); </del> <ins> val = dist[curDist * categories + cat]; assert(THCNumerics<T>::ge(val, zero)); sum = THCNumerics<AccT>::add(sum, ScalarConvert<T, AccT>::to(val)); </ins> } // threadIdx.x == 0 has the sum value from this
Code change:
Looking at the values returned from tn.multinomial(1) and counting them, it seems like it returns the values of the multinomial distribution taken from t, i.e. that it has ignored the signs of the values. However, it seem like always returns a tensor filled with zeros.
looking into this

Related discussion:
text: if (threadIdx.x == 0) { // Make sure the sum of our distribution didn't overflow assert(!isinf(sum)); <ins> assert(THCNumerics<AccT>::gt(sum, accZero)); </ins> asmem[0] = sum; smem[0] = sampled[curDist];
Code change:
Hi There, I'm trying to install Pytorch as a module on my university's computing cluster. The node uses CentOS (6.4) x8664. I install running these commands: module load gcclib/5.2.0 cmake/3.8.2 module load gcc/5.2.0 module load anaconda3/4.0.0 export CMAKEPREFIXPATH="(which conda))/../" export NOCUDA=1 git clone --recursive cd pytorch/ python install --prefix=${HOME} Things look fine as it installs but then I run into the following errors, ending in the process terminating with error relating to GCC? I've tried with version GCC 6.2.0 and the same result occurs. Not sure what to even try to fix this! Thanks for any help you can provide!
Same here, with gcc 5.4.0
I don't think building from source works very well with gcc 5.4. Could you install gcc 4.9 and try compiling?
I get this error instead when using gcc 4.9.0, doesn't make it very far at all.
Hi I think this is broken after / due to
I have the same problem ( etc.) with gcc 4.8.5 on Linux with the current head ( ) What works for me is to add at the beginning of the following four files: (see also -- this can be turned into a pull request very easily) This fix is the same as but for different files.
This worked for me Thank you.
fixed in latest master, thanks to

Related discussion:
text: <ins> #define __STDC_FORMAT_MACROS </ins> #include <Python.h> #ifdef _MSC_VER #include <Windows.h>
Code change:
Hi There, I'm trying to install Pytorch as a module on my university's computing cluster. The node uses CentOS (6.4) x8664. I install running these commands: module load gcclib/5.2.0 cmake/3.8.2 module load gcc/5.2.0 module load anaconda3/4.0.0 export CMAKEPREFIXPATH="(which conda))/../" export NOCUDA=1 git clone --recursive cd pytorch/ python install --prefix=${HOME} Things look fine as it installs but then I run into the following errors, ending in the process terminating with error relating to GCC? I've tried with version GCC 6.2.0 and the same result occurs. Not sure what to even try to fix this! Thanks for any help you can provide!
Same here, with gcc 5.4.0
I don't think building from source works very well with gcc 5.4. Could you install gcc 4.9 and try compiling?
I get this error instead when using gcc 4.9.0, doesn't make it very far at all.
Hi I think this is broken after / due to
I have the same problem ( etc.) with gcc 4.8.5 on Linux with the current head ( ) What works for me is to add at the beginning of the following four files: (see also -- this can be turned into a pull request very easily) This fix is the same as but for different files.
This worked for me Thank you.
fixed in latest master, thanks to

Related discussion:
text: <ins> #define __STDC_FORMAT_MACROS </ins> #include <Python.h> #include <structmember.h>
Code change:
Hi, Looking at the formulas of LSTM in , in the third equation (gt), the suffix of the second W should be changed from W{hc} to W{hg}. The correct formula: gt=tanh(W{ig}xt+b{ig}+W{hg}h{(t−1)}+b_{hg}) Cheers, Navid

Related discussion:
text: begin{array}{ll} i_t = sigma(W_{ii} x_t + b_{ii} + W_{hi} h_{(t-1)} + b_{hi})  f_t = sigma(W_{if} x_t + b_{if} + W_{hf} h_{(t-1)} + b_{hf})  <del> g_t = tanh(W_{ig} x_t + b_{ig} + W_{hc} h_{(t-1)} + b_{hg})  </del> <ins> g_t = tanh(W_{ig} x_t + b_{ig} + W_{hg} h_{(t-1)} + b_{hg})  </ins> o_t = sigma(W_{io} x_t + b_{io} + W_{ho} h_{(t-1)} + b_{ho})  c_t = f_t c_{(t-1)} + i_t g_t  h_t = o_t tanh(c_t)
Code change:
The three-clause BSD license in file LICENSE says in clause 1 "Redistributions of source code must retain the above copyright notice..." However, there is no longer a copyright notice in the file; it appears to have been removed in commit (see ).
cc

Related discussion:
text: <ins> From PyTorch: Copyright (c) 2016-     Facebook, Inc            (Adam Paszke) Copyright (c) 2014-     Facebook, Inc            (Soumith Chintala) Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) Copyright (c) 2012-2014 Deepmind Technologies    (Koray Kavukcuoglu) Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) Copyright (c) 2011-2013 NYU                      (Clement Farabet) Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston) Copyright (c) 2006      Idiap Research Institute (Samy Bengio) Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz) From Caffe2: Copyright (c) 2016-present, Facebook Inc. All rights reserved. All contributions by Facebook: Copyright (c) 2016 Facebook Inc. All contributions by Google: Copyright (c) 2015 Google Inc. All rights reserved. All contributions by Yangqing Jia: Copyright (c) 2015 Yangqing Jia All rights reserved. All contributions from Caffe: Copyright(c) 2013, 2014, 2015, the respective contributors All rights reserved. All other contributions: Copyright(c) 2015, 2016 the respective contributors All rights reserved. Caffe2 uses a copyright model similar to Caffe: each contributor holds copyright over their contributions to Caffe2. The project versioning records all such contribution and copyright details. If a contributor wants to further mark their specific copyright on a particular contribution, they should indicate their copyright solely in the commit message of the change when it is committed. </ins> All rights reserved. Redistribution and use in source and binary forms, with or without
Code change:
The three-clause BSD license in file LICENSE says in clause 1 "Redistributions of source code must retain the above copyright notice..." However, there is no longer a copyright notice in the file; it appears to have been removed in commit (see ).
cc

Related discussion:
text: <del> From PyTorch: Copyright (c) 2016-     Facebook, Inc            (Adam Paszke) Copyright (c) 2014-     Facebook, Inc            (Soumith Chintala) Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) Copyright (c) 2012-2014 Deepmind Technologies    (Koray Kavukcuoglu) Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) Copyright (c) 2011-2013 NYU                      (Clement Farabet) Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston) Copyright (c) 2006      Idiap Research Institute (Samy Bengio) Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz) From Caffe2: Copyright (c) 2016-present, Facebook Inc. All rights reserved. All contributions by Facebook: Copyright (c) 2016 Facebook Inc. All contributions by Google: Copyright (c) 2015 Google Inc. All rights reserved. All contributions by Yangqing Jia: Copyright (c) 2015 Yangqing Jia All rights reserved. All contributions from Caffe: Copyright(c) 2013, 2014, 2015, the respective contributors All rights reserved. All other contributions: Copyright(c) 2015, 2016 the respective contributors All rights reserved. Caffe2 uses a copyright model similar to Caffe: each contributor holds copyright over their contributions to Caffe2. The project versioning records all such contribution and copyright details. If a contributor wants to further mark their specific copyright on a particular contribution, they should indicate their copyright solely in the commit message of the change when it is committed. </del> ======================================================================= Software under third_party =======================================================================
Code change:
PyTorch version: 0.4.0 Is debug build: No CUDA used to build PyTorch: 9.0.176 OS: Ubuntu 16.04.3 LTS GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 CMake version: version 3.9.4 Python version: 3.6 Is CUDA available: Yes CUDA runtime version: 9.0.176 GPU models and configuration: GPU 0: TITAN X (Pascal) GPU 1: TITAN X (Pascal) Nvidia driver version: 384.98 cuDNN version: Probably one of the following: /usr/lib/x8664-linux- /usr/lib/x8664-linux- /usr/lib/x8664-linux-gnu/libcudnnstaticv7.a /usr/local/lib/python2.7/dist- /usr/local/lib/python3.5/dist- Versions of relevant libraries: [pip3] numpy (1.14.1) [pip3] numpydoc (0.6.0) [pip3] torch (0.4.0) [pip3] torchvision (0.2.0) [conda] cuda90 1.0 h6433d270 pytorch [conda] magma-cuda90 2.3.0 1 soumith [conda] pytorch 0.4.0 py36cuda9.0.176cudnn7.1.21 [cuda90] pytorch [conda] torchvision 0.2.1 py361 pytorch
() returns 7102
Possibly related:
I'm not sure why, but I can't reproduce this on master. I can reproduce on 0.4 though.
Never mind, this error happens when CUDNN is updated regardless of pytorch version.

Related discussion:
text: def grid_sampler(input, grid, padding_mode): <del> if cudnn.is_acceptable(input.data) and padding_mode == 'zeros' and input.dim() == 4: </del> <ins> if (cudnn.is_acceptable(input.data) and padding_mode == 'zeros' and input.dim() == 4 and input.size(1) <= 1024):  # as of cudnn 7102, will not work for larger than 1024 </ins> return torch.cudnn_grid_sampler(input, grid) else: return GridSampler.apply(input, grid, padding_mode)
Code change:
Einsum currently modifies variables in-place (without an explicit indication that it does so), which prevents pytorch from automatically backpropagating. Results in the following runtime error: Demonstration and discussion can also be found . PyTorch or Caffe2: PyTorch How you installed PyTorch (conda, pip, source): pip OS: PyTorch version: 0.4.0 Python version: 3.6.1
Oops. Thank you for reporting and the minimal example. I'll see to get that fixed.
Saw the same issue over here. Thank you !
Is cloning the tensor before passing to einsum a valid workaround?
Yes, but a somewhat expensive one. If you have the ability to recompile, you could also apply the PR fixing this. Somehow it seems to be stuck in the review queue because it hit an unrelated CI problem...
Okay so how to use it then?
Just get a recent enough master and it will work.

Related discussion:
text: upstream="$1" pr="$2" git diff --name-only "$upstream" "$pr" <del> git diff --name-only "$upstream" "$pr" | grep -Eq '^(CMakeLists.txt|Makefile|.gitmodules|.jenkins/caffe2|binaries|caffe|caffe2|cmake|conda|docker|docs/caffe2|modules|scripts|third_party)' </del> <ins> # For safety, unconditionally trigger for any changes. #git diff --name-only "$upstream" "$pr" | grep -Eq '^(CMakeLists.txt|Makefile|.gitmodules|.jenkins/caffe2|binaries|caffe|caffe2|cmake|conda|docker|docs/caffe2|modules|scripts|third_party)' </ins>
Code change:
Einsum currently modifies variables in-place (without an explicit indication that it does so), which prevents pytorch from automatically backpropagating. Results in the following runtime error: Demonstration and discussion can also be found . PyTorch or Caffe2: PyTorch How you installed PyTorch (conda, pip, source): pip OS: PyTorch version: 0.4.0 Python version: 3.6.1
Oops. Thank you for reporting and the minimal example. I'll see to get that fixed.
Saw the same issue over here. Thank you !
Is cloning the tensor before passing to einsum a valid workaround?
Yes, but a somewhat expensive one. If you have the ability to recompile, you could also apply the PR fixing this. Somehow it seems to be stuck in the review queue because it hit an unrelated CI problem...
Okay so how to use it then?
Just get a recent enough master and it will work.

Related discussion:
text: upstream="$1" pr="$2" git diff --name-only "$upstream" "$pr" <del> git diff --name-only "$upstream" "$pr" | grep -Eq '^(aten/|caffe2/|.jenkins/pytorch|docs/(make.bat|Makefile|requirements.txt|source)|mypy|requirements.txt|setup.py|test/|third_party/|tools/|.gitmodules|torch/)' </del> <ins> # Now that PyTorch build depends on Caffe2, unconditionally trigger # for any changes. # TODO: Replace this with a NEGATIVE regex that allows us to blacklist # files (letting us skip builds when they are unnecessary) #git diff --name-only "$upstream" "$pr" | grep -Eq '^(aten/|caffe2/|.jenkins/pytorch|docs/(make.bat|Makefile|requirements.txt|source)|mypy|requirements.txt|setup.py|test/|third_party/|tools/|.gitmodules|torch/)' </ins>
Code change:
Einsum currently modifies variables in-place (without an explicit indication that it does so), which prevents pytorch from automatically backpropagating. Results in the following runtime error: Demonstration and discussion can also be found . PyTorch or Caffe2: PyTorch How you installed PyTorch (conda, pip, source): pip OS: PyTorch version: 0.4.0 Python version: 3.6.1
Oops. Thank you for reporting and the minimal example. I'll see to get that fixed.
Saw the same issue over here. Thank you !
Is cloning the tensor before passing to einsum a valid workaround?
Yes, but a somewhat expensive one. If you have the ability to recompile, you could also apply the PR fixing this. Somehow it seems to be stuck in the review queue because it hit an unrelated CI problem...
Okay so how to use it then?
Just get a recent enough master and it will work.

Related discussion:
text: unset(CUDA_ARCH_PTX CACHE) endif() <del> if(DEFINED ENV{TORCH_CUDA_ARCH_LIST}) </del> <ins> if($ENV{TORCH_CUDA_ARCH_LIST}) </ins> # Pass CUDA architecture directly set(__cuda_arch_bin $ENV{TORCH_CUDA_ARCH_LIST}) message(STATUS "Set CUDA arch from TORCH_CUDA_ARCH_LIST: ${__cuda_arch_bin}")
Code change:
Consider the following: A reasonable reading of this message is that the order of the parameters should be reversed, but this isn't equivalent: The problem is that the second signature has a keyword-only argument but it's printed. It also doesn't include defaults and such, but that's probably secondary. In this case the problem is at least flagged, but it's not clear to me whether there are other deprecated signatures that silently suggest the wrong thing. Please copy and paste the output from our (or fill out the checklist below manually). You can get the script and run it with: Collecting environment information... PyTorch version: 1.5.0a0+ Is debug build: Yes CUDA used to build PyTorch: Could not collect OS: CentOS Linux 7 (Core) GCC version: (GCC) 7.4.0 CMake version: version 3.14.0 Python version: 3.7 Is CUDA available: No CUDA runtime version: 9.2.88 GPU models and configuration: GPU 0: Tesla M40 GPU 1: Tesla M40 Nvidia driver version: 396.69 cuDNN version: /usr/local/cuda-9.2/targets/x8664- Versions of relevant libraries: [pip] numpy==1.17.2 [pip] torch==1.5.0a0+ [conda] blas 1.0 mkl [conda] mkl 2019.4 243 [conda] mkl-include 2019.4 243 [conda] mkl-service 2.3.0 py37he904b0f0 [conda] mklfft 1.0.14 py37ha843d7b0 [conda] mklrandom 1.1.0 py37hd6b4f25_0 [conda] torch 1.5.0a0+ <pip<!-- Add any other context about the problem here. --

Related discussion:
text: } std::string FunctionSignature::toString() const { <ins> // TODO: consider printing more proper schema strings with defaults, optionals, etc. </ins> std::ostringstream ss; <ins> bool keyword_already = false; </ins> ss << "("; int i = 0; for (auto& param : params) { if (i != 0) { ss << ", "; } <ins> if (param.keyword_only && !keyword_already) { ss << "*, "; keyword_already = true; } </ins> ss << param.type_name() << " " << param.name; i++; }
Code change:
See Docker run fails with , which is due to the fact that is specified in docker container: Which results in: CI cc
Check that adding to manywheels image results in a failure:
Tentatively marking hi-pri since nightly testing are failing
This is resolved, here is the successful run:

Related discussion:
text: return ret; } <del> Variable VariableType::as_variable(Tensor tensor) const { </del> <ins> static Variable as_variable(Tensor tensor) { </ins> return make_variable(std::move(tensor)); } <del> std::tuple<Variable, Variable> VariableType::as_variable(std::tuple<Tensor, Tensor> tensors) const { </del> <ins> static std::tuple<Variable, Variable> as_variable(std::tuple<Tensor, Tensor> tensors) { </ins> return std::make_tuple<>( make_variable(std::move(std::get<0>(tensors))), make_variable(std::move(std::get<1>(tensors)))); } <del> std::tuple<Variable, Variable, Variable> VariableType::as_variable(std::tuple<Tensor, Tensor, Tensor> tensors) const { </del> <ins> static std::tuple<Variable, Variable, Variable> as_variable(std::tuple<Tensor, Tensor, Tensor> tensors) { </ins> return std::make_tuple<>( make_variable(std::move(std::get<0>(tensors))), make_variable(std::move(std::get<1>(tensors))), make_variable(std::move(std::get<2>(tensors)))); } <del> std::tuple<Variable, Variable, Variable, Variable> VariableType::as_variable(std::tuple<Tensor, Tensor, Tensor, Tensor> tensors) const { </del> <ins> static std::tuple<Variable, Variable, Variable, Variable> as_variable(std::tuple<Tensor, Tensor, Tensor, Tensor> tensors) { </ins> return std::make_tuple<>( make_variable(std::move(std::get<0>(tensors))), make_variable(std::move(std::get<1>(tensors))),
Code change:
See Docker run fails with , which is due to the fact that is specified in docker container: Which results in: CI cc
Check that adding to manywheels image results in a failure:
Tentatively marking hi-pri since nightly testing are failing
This is resolved, here is the successful run:

Related discussion:
text: make_variable(std::move(std::get<3>(tensors)))); } <del> std::vector<Variable> VariableType::as_variable(TensorList tl) const { </del> <ins> static std::vector<Variable> as_variable(TensorList tl) { </ins> std::vector<Variable> variables; for (auto& t : tl) { variables.emplace_back(make_variable(std::move(t)));
Code change:
See Docker run fails with , which is due to the fact that is specified in docker container: Which results in: CI cc
Check that adding to manywheels image results in a failure:
Tentatively marking hi-pri since nightly testing are failing
This is resolved, here is the successful run:

Related discussion:
text: } } <del> variable_list flatten(const TensorList& tensors) { </del> <ins> static variable_list flatten(const TensorList& tensors) { </ins> return cast_tensor_list(tensors); } <del> variable_list flatten(const Tensor& x, const TensorList& y) { </del> <ins> static variable_list flatten(const Tensor& x, const TensorList& y) { </ins> std::vector<Variable> r; r.reserve(1 + y.size()); r.emplace_back(x);
Code change:
See Docker run fails with , which is due to the fact that is specified in docker container: Which results in: CI cc
Check that adding to manywheels image results in a failure:
Tentatively marking hi-pri since nightly testing are failing
This is resolved, here is the successful run:

Related discussion:
text: return r; } <del> variable_list flatten(const Tensor& x, const TensorList& y, const Tensor& z) { </del> <ins> static variable_list flatten(const Tensor& x, const TensorList& y, const Tensor& z) { </ins> std::vector<Variable> r; r.reserve(2 + y.size()); r.emplace_back(x);
Code change:
See Docker run fails with , which is due to the fact that is specified in docker container: Which results in: CI cc
Check that adding to manywheels image results in a failure:
Tentatively marking hi-pri since nightly testing are failing
This is resolved, here is the successful run:

Related discussion:
text: return r; } <del> std::vector<Tensor> as_tensor_list(std::vector<Variable> &vars) { </del> <ins> static std::vector<Tensor> as_tensor_list(std::vector<Variable> &vars) { </ins> std::vector<Tensor> tensors; for (auto& v : vars) { tensors.emplace_back(std::move(v));
Code change:
See Docker run fails with , which is due to the fact that is specified in docker container: Which results in: CI cc
Check that adding to manywheels image results in a failure:
Tentatively marking hi-pri since nightly testing are failing
This is resolved, here is the successful run:

Related discussion:
text: return self.clone(); } <del> std::vector<int64_t> to_arg_sizes(TensorList tensors, int64_t dim) { </del> <ins> static std::vector<int64_t> to_arg_sizes(TensorList tensors, int64_t dim) { </ins> std::vector<int64_t> arg_sizes(tensors.size()); for (size_t i = 0; i < tensors.size(); ++i) { arg_sizes[i] = tensors[i].size(dim);