Skip to content

Conversation

@mamar123
Copy link
Contributor

@mamar123 mamar123 commented Aug 5, 2025

No description provided.

@mamar123 mamar123 requested a review from a team as a code owner August 5, 2025 11:59
@copy-pr-bot
Copy link

copy-pr-bot bot commented Aug 5, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions
Copy link

github-actions bot commented Aug 5, 2025

👋 Hi mamar123! Thank you for contributing to ai-dynamo/nixl.

Your PR reviewers will review your contribution then trigger the CI to test your changes.

🚀

@mamar123
Copy link
Contributor Author

mamar123 commented Aug 5, 2025

/ok to test e4f4acf

@mamar123
Copy link
Contributor Author

mamar123 commented Aug 5, 2025

/build

ovidiusm
ovidiusm previously approved these changes Aug 6, 2025
aranadive
aranadive previously approved these changes Aug 7, 2025
@mamar123 mamar123 dismissed stale reviews from aranadive and ovidiusm via 35bd079 August 11, 2025 08:57
@mamar123 mamar123 force-pushed the obj_gtest_enhance_pr branch from e4f4acf to 35bd079 Compare August 11, 2025 08:57
@ai-dynamo ai-dynamo deleted a comment from copy-pr-bot bot Aug 11, 2025
@mamar123
Copy link
Contributor Author

/ok to test 35bd079

localBackendEngine_, localBackendEngine_, local_agent_name, local_agent_name, mem_cfg);
transfer.setupMems();

nixl_xfer_op_t op = NIXL_WRITE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why a stack variable assist here.

}

TEST_P(setupObjTestFixture, writeWithOffsetsTest) {
transferMemConfig mem_cfg{.numEntries_ = 2};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 2 a must? if so, please use a named constant, otherwise a random value.

localBackendEngine_, localBackendEngine_, local_agent_name, local_agent_name);

nixlMetaDesc meta_desc;
meta_desc.devId = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 1 a must? if so please use named constant, otherwise a random value

uint8_t src_byte = getRandomInt(0, 255);

// First, write entire buffer to OBJ in a single chunk (no offsets)
transferMemConfig mem_cfg_write{.numEntries_ = 1, .entrySize_ = 128, .srcBufByte_ = src_byte};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same note regarding 1, 128

}

TEST_P(setupObjTestFixture, readWithOffsetsTest) {
uint8_t src_byte = getRandomInt(0, 255);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To have less hard coded numbers, I would suggest:

uint8_t src_byte = getRandomInt(0, std::numeric_limits<uint8_t>::max());

Comment on lines +147 to +151
TEST_P(setupObjTestFixture, dramAsDstMemTest) {
transferHandler<DRAM_SEG, DRAM_SEG> transfer(
localBackendEngine_, localBackendEngine_, local_agent_name, local_agent_name);
ASSERT_EQ(transfer.prepareTransfer(NIXL_WRITE), NIXL_ERR_INVALID_PARAM);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(All around)

When you have a single place to use a class you can do that creating a temporary instance with shorter life span (gone after function call), i.e.:

TEST_P(setupObjTestFixture, dramAsDstMemTest) {
    ASSERT_EQ(transferHandler<DRAM_SEG, DRAM_SEG>(localBackendEngine_, localBackendEngine_, local_agent_name, local_agent_name).prepareTransfer(NIXL_WRITE), NIXL_ERR_INVALID_PARAM);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants