-
Notifications
You must be signed in to change notification settings - Fork 3
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
A new method for the greedy optimizer #41
Conversation
remove deps of FasterExp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add parameters alpha, move temperature
to greedy.
src/greedy.jl
Outdated
@@ -5,7 +5,20 @@ end | |||
|
|||
struct MinSpaceOut end | |||
struct MinSpaceDiff end | |||
struct HyperGreedy{T} | |||
t::T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temperature
Added a new struct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GreedyStrategy
seems to be not nessesary. We can move the fields to GreedyMethod
.
|
||
MinSpaceOut() = GreedyStrategy(0.0, 0.0) | ||
MinSpaceDiff() = GreedyStrategy(1.0, 0.0) | ||
|
||
|
||
struct LegInfo{ET} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vi
and vj
not defined here. How about:
We use number 0, 1, 2 to denote the output tensor, the first input tensor and the second input tensor,
and use e.g. `l01` to denote the set of labels that appear in both the output tensor and the input tensor.
src/kahypar.jl
Outdated
# eincode = optimize_code(parse_eincode(incidence_list, tree, vertices=1:length(parts)), log2_sizes, sub_optimizer) | ||
# if eincode isa SlicedEinsum | ||
# @assert eincode.slicing == 0 | ||
# eincode = eincode.eins | ||
# end | ||
# tree = parse_tree(eincode, collect(1:length(parts))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# eincode = optimize_code(parse_eincode(incidence_list, tree, vertices=1:length(parts)), log2_sizes, sub_optimizer) | |
# if eincode isa SlicedEinsum | |
# @assert eincode.slicing == 0 | |
# eincode = eincode.eins | |
# end | |
# tree = parse_tree(eincode, collect(1:length(parts))) |
src/kahypar.jl
Outdated
@assert length(res.slicing) == 0 | ||
res = res.eins | ||
end | ||
# res = optimize_greedy(inset, iy1, size_dict; method=greedy_config.method, nrepeat=greedy_config.nrepeat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# res = optimize_greedy(inset, iy1, size_dict; method=greedy_config.method, nrepeat=greedy_config.nrepeat) |
test/greedy.jl
Outdated
# eincode3 = ein"(ab,acd),bcef,e,df->" | ||
# Random.seed!(2) | ||
# optcode3 = optimize_greedy(eincode3, size_dict) | ||
# tc, sc = timespace_complexity(optcode3, edge_sizes) | ||
# @test 16 <= tc <= log2(exp2(10)+exp2(16)+exp2(15)+exp2(9)+1e-8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# eincode3 = ein"(ab,acd),bcef,e,df->" | |
# Random.seed!(2) | |
# optcode3 = optimize_greedy(eincode3, size_dict) | |
# tc, sc = timespace_complexity(optcode3, edge_sizes) | |
# @test 16 <= tc <= log2(exp2(10)+exp2(16)+exp2(15)+exp2(9)+1e-8) |
These commented parts have been removed, and the doc strings are revised. |
The following changes have been made in this PR:
BetterExp
is removed, since it has been merge toBase
since[email protected]
, and currentlyexp2
provided byBase
seems better:tree_greedy
.