Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

feat: support creating BaguaTensor by passing torch tensor directly #19

Merged

Conversation

NOBLES5E
Copy link
Contributor

No description provided.

@NOBLES5E NOBLES5E marked this pull request as draft June 29, 2021 04:21
@todo
Copy link

todo bot commented Jun 30, 2021

also check recv buf?

// TODO: also check recv buf?
assert_eq!(
send_tensor.num_elements_allocated() % self.nranks,
0,
"tensors must be aligned before using allscatter"
);


This comment was generated by todo based on a TODO comment in 13af9dd in #19. cc @BaguaSys.

@pr-triage pr-triage bot added the PR: draft label Jun 30, 2021
@todo
Copy link

todo bot commented Jun 30, 2021

separate crate for this

// TODO: separate crate for this
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(dead_code)]
pub const DeviceType_CPU: DeviceType = 0;
pub const DeviceType_CUDA: DeviceType = 1;


This comment was generated by todo based on a TODO comment in 13af9dd in #19. cc @BaguaSys.

@todo
Copy link

todo bot commented Jun 30, 2021

sanity check

// TODO: sanity check
let dtype = torch_tensor
.getattr("dtype")
.expect("must pass valid torch tensor")
.repr()?
.to_string();


This comment was generated by todo based on a TODO comment in 13af9dd in #19. cc @BaguaSys.

@NOBLES5E NOBLES5E marked this pull request as ready for review June 30, 2021 00:43
@todo
Copy link

todo bot commented Jun 30, 2021

simplify args

// TODO: simplify args
pub fn get_communication_tensor(
&self,
stream_ptr: u64,


This comment was generated by todo based on a TODO comment in 9b549fc in #19. cc @BaguaSys.

@NOBLES5E NOBLES5E linked an issue Jun 30, 2021 that may be closed by this pull request
NOBLES5E added 2 commits June 30, 2021 12:57
…sier' of github.com:BaguaSys/bagua-core into issue-6-Pass_torch_tensor_directly_to_make_interface_easier
@NOBLES5E NOBLES5E merged commit c9b9473 into master Jun 30, 2021
@NOBLES5E NOBLES5E deleted the issue-6-Pass_torch_tensor_directly_to_make_interface_easier branch June 30, 2021 05:00
This was referenced Jun 30, 2021
NOBLES5E added a commit that referenced this pull request Jul 1, 2021
)

BREAKING CHANGE: `BaguaBucketPy` and `BaguaTensorPy` now require name. `BaguaTensorPy` is created by passing pytorch tensor directly now.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass torch tensor directly to make interface easier
1 participant