Skip to content

Update topi/cuda schedules to use target.max_num_threads - #577

Merged
tqchen merged 3 commits into
apache:masterfrom
masahi:use-target-max-numthreads
Oct 23, 2017
Merged

Update topi/cuda schedules to use target.max_num_threads#577
tqchen merged 3 commits into
apache:masterfrom
masahi:use-target-max-numthreads

Conversation

@masahi

@masahimasahi commented Oct 22, 2017

Copy link
Copy Markdown
Member

Update topi/cuda schedules to be consistent with #556.

With this commit, all unit tests in topi should pass out of the box with ROCm and OpenCL backend.
For OpenCL backend, I only checked it with AMD device (R9 Nano).

Comment threadpython/tvm/target.py Outdated


def get_max_num_threads():
"""Returns the maximum number of threads under current target.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you remove this function and simply use tvm.target.current_target().max_num_threads?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Can tvm.target.current_target() be None?

@masahimasahiOct 22, 2017

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I did this following your usage of max_num_threads here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use tvm.target.current_target(allow_missing=False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I just think we should remove this function and inline its body to the callers

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

since the function itself is small(one line)

@masahimasahiOct 22, 2017

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

ok

tvm.target.current_target(allow_none=False).max_num_threads
right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

k

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

pushed

Comment threadpython/tvm/target.py Outdated


def get_max_num_threads():
"""Returns the maximum number of threads under current target.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

since the function itself is small(one line)

@tqchen
tqchen merged commit 1221835 into apache:masterOct 23, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@masahi@tqchen