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

Small ARIMA-related bug fixes in Hessenberg reduction and make_arima #4017

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cpp/src_prims/linalg/batched/matrix.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1147,8 +1147,8 @@ __global__ void hessenberg_reduction_kernel(T* d_U, T* d_H, T* d_hh, int n) {
if (i < n) {
b_H[j * n + i] -= (T)2 * hh_k_i * shared_mem[0];
}
__syncthreads();
}
__syncthreads();

// H[:, k+1:] = H[:, k+1:] - 2 * (H[:, k+1:] * uk) * uk'
// Note: we do a coalesced load of hh_k in shared memory
Expand Down Expand Up @@ -1203,8 +1203,8 @@ __global__ void hessenberg_reduction_kernel(T* d_U, T* d_H, T* d_hh, int n) {
if (i < n) {
b_U[j * n + i] -= (T)2 * hh_k_i * shared_mem[0];
}
__syncthreads();
}
__syncthreads();

b_hh_k -= n - k;
}
Expand Down
7 changes: 5 additions & 2 deletions cpp/src_prims/random/make_arima.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ void make_arima(DataT* out, int batch_size, int n_obs, ML::ARIMAOrder order,

// Generate parameters. We draw temporary random parameters and transform
// them to create the final parameters.
// Note: sigma2 is unused so we don't even initialize it
ML::ARIMAParams<DataT> params_temp, params;
params_temp.allocate(order, batch_size, allocator, stream, false);
params.allocate(order, batch_size, allocator, stream, true);
Expand All @@ -170,7 +169,11 @@ void make_arima(DataT* out, int batch_size, int n_obs, ML::ARIMAOrder order,
gpu_gen.uniform(params_temp.sma, batch_size * order.Q, (DataT)-1.0,
(DataT)1.0, stream);
}
params.mu = params_temp.mu; // No need to copy, just reuse the pointer
// Note: sigma2 is unused, we just memset it to zero
CUDA_CHECK(
cudaMemsetAsync(params_temp.sigma2, 0, batch_size * sizeof(DataT), stream));
// No need to copy, just reuse the pointer
params.mu = params_temp.mu;
TimeSeries::batched_jones_transform(order, batch_size, false, params_temp,
params, allocator, stream);

Expand Down