Skip to content

Commit c8803ea

Browse files
committed
PR todo cleanup
1 parent 841a66f commit c8803ea

File tree

45 files changed

+494
-801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+494
-801
lines changed

lib/local-execution/include/local-execution/atomic_task_invocation/atomic_task_binding.dtg.toml

Lines changed: 0 additions & 30 deletions
This file was deleted.

lib/local-execution/include/local-execution/atomic_task_invocation/atomic_task_graph.dtg.toml

Lines changed: 0 additions & 21 deletions
This file was deleted.

lib/local-execution/include/local-execution/atomic_task_invocation/atomic_task_invocation.dtg.toml

Lines changed: 0 additions & 22 deletions
This file was deleted.

lib/local-execution/include/local-execution/local_task_argument_accessor.h

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,16 @@ namespace FlexFlow {
1414
struct LocalTaskArgumentAccessor : public ITaskArgumentAccessor {
1515
explicit LocalTaskArgumentAccessor(
1616
Allocator const &allocator,
17-
std::unordered_map<TaskTensorParameter, TensorSlotBacking> const
17+
std::unordered_map<TaskTensorParameter, GenericTensorAccessorW> const
1818
&tensor_slots_backing,
19-
std::unordered_map<arg_slot_id_t, ConcreteArgSpec> const &arg_slots_backing,
19+
ProfilingSettings const &profiling_settings,
20+
device_handle_t const &ff_handle,
21+
DeviceType kernel_device_type,
22+
PCGOperatorAttrs const &op_attrs,
23+
std::optional<LossAttrs> const &loss_attrs,
24+
std::optional<PerDeviceOpState> const &per_device_op_state,
25+
FFIterationConfig const &iteration_config,
26+
std::optional<OptimizerAttrs> const &optimizer_attrs,
2027
size_t device_idx);
2128

2229
LocalTaskArgumentAccessor(LocalTaskArgumentAccessor const &) = delete;
@@ -26,18 +33,33 @@ struct LocalTaskArgumentAccessor : public ITaskArgumentAccessor {
2633

2734
GenericTensorAccessor get_tensor(TaskTensorParameter slot,
2835
Permissions priv) const override;
29-
VariadicGenericTensorAccessor get_variadic_tensor(
30-
TaskTensorParameter, Permissions priv) const override;
36+
37+
ProfilingSettings get_profiling_settings() const override;
38+
device_handle_t get_ff_handle() const override;
39+
DeviceType get_kernel_device_type() const override;
40+
PCGOperatorAttrs get_op_attrs() const override;
41+
LossAttrs get_loss_attrs() const override;
42+
PerDeviceOpState get_per_device_op_state() const override;
43+
FFIterationConfig get_iteration_config() const override;
44+
OptimizerAttrs get_optimizer_attrs() const override;
3145

3246
Allocator get_allocator() const override;
3347

3448
device_id_t get_device_idx() const override;
3549

3650
private:
3751
Allocator allocator;
38-
std::unordered_map<TaskTensorParameter, TensorSlotBacking>
39-
tensor_slots_backing;
40-
std::unordered_map<arg_slot_id_t, ConcreteArgSpec> arg_slots_backing;
52+
std::unordered_map<TaskTensorParameter, GenericTensorAccessorW> tensor_slots_backing;
53+
54+
ProfilingSettings profiling_settings;
55+
device_handle_t ff_handle;
56+
DeviceType kernel_device_type;
57+
PCGOperatorAttrs op_attrs;
58+
std::optional<LossAttrs> loss_attrs;
59+
std::optional<PerDeviceOpState> per_device_op_state;
60+
FFIterationConfig iteration_config;
61+
std::optional<OptimizerAttrs> optimizer_attrs;
62+
4163
device_id_t device_idx;
4264
};
4365

lib/local-execution/include/local-execution/local_task_registry.dtg.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ features = [
88
]
99

1010
includes = [
11-
"task-spec/task_signature_impl.dtg.h",
11+
"task-spec/task_impl_function.dtg.h",
1212
]
1313

1414
src_includes = [
@@ -18,4 +18,4 @@ src_includes = [
1818

1919
[[fields]]
2020
name = "task_mapping"
21-
type = "std::unordered_map<::FlexFlow::task_id_t, ::FlexFlow::TaskSignatureAndImpl>"
21+
type = "std::unordered_map<::FlexFlow::task_id_t, ::FlexFlow::TaskImplFunction>"

lib/local-execution/include/local-execution/local_tensor_backing.dtg.toml

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/local-execution/include/local-execution/local_tensor_backing.h

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#ifndef _FLEXFLOW_LIB_LOCAL_EXECUTION_INCLUDE_LOCAL_EXECUTION_PER_DEVICE_OP_STATE_INITIALIZATION_H
2+
#define _FLEXFLOW_LIB_LOCAL_EXECUTION_INCLUDE_LOCAL_EXECUTION_PER_DEVICE_OP_STATE_INITIALIZATION_H
3+
4+
#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h"
5+
namespace FlexFlow {
6+
7+
DynamicOpenDataflowGraph
8+
perform_per_device_op_state_initialization(
9+
DynamicOpenDataflowGraph const &);
10+
11+
} // namespace FlexFlow
12+
13+
#endif
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#ifndef _FLEXFLOW_LIB_LOCAL_EXECUTION_INCLUDE_LOCAL_EXECUTION_TASK_EXECUTION_H
2+
#define _FLEXFLOW_LIB_LOCAL_EXECUTION_INCLUDE_LOCAL_EXECUTION_TASK_EXECUTION_H
3+
4+
#include "kernels/profiling_settings.dtg.h"
5+
#include "op-attrs/ops/loss_functions/loss_attrs.dtg.h"
6+
#include "task-spec/per_device_op_state.dtg.h"
7+
#include "task-spec/dynamic_graph/dynamic_node_invocation.dtg.h"
8+
#include "task-spec/task_argument_accessor/task_argument_accessor.h"
9+
10+
namespace FlexFlow {
11+
12+
TaskArgumentAccessor
13+
make_task_argument_accessor_for_invocation(
14+
DynamicNodeInvocation const &invocation,
15+
ProfilingSettings const &profiling_settings,
16+
DeviceType kernel_device_type,
17+
PCGOperatorAttrs op_attrs,
18+
std::optional<LossAttrs> const &loss_attrs,
19+
std::optional<PerDeviceOpState> const &per_device_op_state,
20+
FFIterationConfig iteration_config,
21+
std::optional<OptimizerAttrs> const &optimizer_attrs);
22+
23+
void
24+
execute_dynamic_node_invocation(
25+
DynamicNodeInvocation const &invocation,
26+
ProfilingSettings const &profiling_settings,
27+
DeviceType kernel_device_type,
28+
PCGOperatorAttrs op_attrs,
29+
std::optional<LossAttrs> const &loss_attrs,
30+
std::optional<PerDeviceOpState> const &per_device_op_state,
31+
FFIterationConfig iteration_config,
32+
std::optional<OptimizerAttrs> const &optimizer_attrs);
33+
34+
} // namespace FlexFlow
35+
36+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#ifndef _FLEXFLOW_LIB_LOCAL_EXECUTION_INCLUDE_LOCAL_EXECUTION_TENSOR_ALLOCATION_H
2+
#define _FLEXFLOW_LIB_LOCAL_EXECUTION_INCLUDE_LOCAL_EXECUTION_TENSOR_ALLOCATION_H
3+
4+
#include "kernels/allocation.h"
5+
#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h"
6+
7+
namespace FlexFlow {
8+
9+
bool no_tensors_are_allocated(DynamicOpenDataflowGraph const &);
10+
bool all_tensors_are_allocated(DynamicOpenDataflowGraph const &);
11+
12+
DynamicValueAttrs
13+
perform_tensor_allocation_for_value(DynamicValueAttrs const &,
14+
Allocator &);
15+
16+
DynamicOpenDataflowGraph
17+
perform_tensor_allocation(DynamicOpenDataflowGraph const &,
18+
std::unordered_map<DynamicValueAttrs, GenericTensorAccessorW> const &preallocated,
19+
Allocator &);
20+
21+
} // namespace FlexFlow
22+
23+
#endif

0 commit comments

Comments
 (0)