2020-08-17 13:26:18 +00:00
|
|
|
package sectorstorage
|
2020-03-23 11:40:02 +00:00
|
|
|
|
|
|
|
import (
|
2020-03-27 20:08:06 +00:00
|
|
|
"github.com/filecoin-project/specs-actors/actors/abi"
|
|
|
|
|
2020-08-17 13:26:18 +00:00
|
|
|
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
|
2020-03-23 11:40:02 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Resources struct {
|
|
|
|
MinMemory uint64 // What Must be in RAM for decent perf
|
2020-03-24 23:37:40 +00:00
|
|
|
MaxMemory uint64 // Memory required (swap + ram)
|
2020-03-23 11:40:02 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads int // -1 = multithread
|
|
|
|
CanGPU bool
|
2020-03-23 11:40:02 +00:00
|
|
|
|
|
|
|
BaseMinMemory uint64 // What Must be in RAM for decent perf (shared between threads)
|
|
|
|
}
|
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
func (r Resources) MultiThread() bool {
|
|
|
|
return r.Threads == -1
|
|
|
|
}
|
|
|
|
|
2020-06-15 12:32:17 +00:00
|
|
|
var ResourceTable = map[sealtasks.TaskType]map[abi.RegisteredSealProof]Resources{
|
2020-03-23 11:40:02 +00:00
|
|
|
sealtasks.TTAddPiece: {
|
2020-08-28 16:26:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{
|
|
|
|
MaxMemory: 8 << 30,
|
|
|
|
MinMemory: 8 << 30,
|
2020-05-08 20:32:34 +00:00
|
|
|
|
|
|
|
Threads: 1,
|
|
|
|
|
|
|
|
BaseMinMemory: 1 << 30,
|
|
|
|
},
|
2020-08-28 16:26:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{
|
|
|
|
MaxMemory: 4 << 30,
|
|
|
|
MinMemory: 4 << 30,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 1,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
|
|
|
BaseMinMemory: 1 << 30,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{
|
2020-03-23 11:40:02 +00:00
|
|
|
MaxMemory: 1 << 30,
|
|
|
|
MinMemory: 1 << 30,
|
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 1,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
|
|
|
BaseMinMemory: 1 << 30,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{
|
2020-04-01 21:24:09 +00:00
|
|
|
MaxMemory: 2 << 10,
|
|
|
|
MinMemory: 2 << 10,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 1,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-01 21:24:09 +00:00
|
|
|
BaseMinMemory: 2 << 10,
|
2020-04-01 18:56:32 +00:00
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{
|
2020-04-01 23:26:47 +00:00
|
|
|
MaxMemory: 8 << 20,
|
|
|
|
MinMemory: 8 << 20,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 1,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-01 23:26:47 +00:00
|
|
|
BaseMinMemory: 8 << 20,
|
2020-04-01 18:56:32 +00:00
|
|
|
},
|
2020-03-23 11:40:02 +00:00
|
|
|
},
|
|
|
|
sealtasks.TTPreCommit1: {
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{
|
2020-05-08 20:32:34 +00:00
|
|
|
MaxMemory: 128 << 30,
|
2020-06-30 17:26:56 +00:00
|
|
|
MinMemory: 112 << 30,
|
2020-05-08 20:32:34 +00:00
|
|
|
|
|
|
|
Threads: 1,
|
|
|
|
|
2020-06-30 17:26:56 +00:00
|
|
|
BaseMinMemory: 10 << 20,
|
2020-05-08 20:32:34 +00:00
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{
|
2020-03-23 11:40:02 +00:00
|
|
|
MaxMemory: 64 << 30,
|
2020-06-30 17:26:56 +00:00
|
|
|
MinMemory: 56 << 30,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 1,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
2020-06-30 17:26:56 +00:00
|
|
|
BaseMinMemory: 10 << 20,
|
2020-03-23 11:40:02 +00:00
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{
|
2020-06-30 17:26:56 +00:00
|
|
|
MaxMemory: 1 << 30,
|
|
|
|
MinMemory: 768 << 20,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 1,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
2020-06-30 17:26:56 +00:00
|
|
|
BaseMinMemory: 1 << 20,
|
2020-03-23 11:40:02 +00:00
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{
|
2020-04-01 21:24:09 +00:00
|
|
|
MaxMemory: 2 << 10,
|
|
|
|
MinMemory: 2 << 10,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 1,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-01 21:24:09 +00:00
|
|
|
BaseMinMemory: 2 << 10,
|
2020-04-01 18:56:32 +00:00
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{
|
2020-04-01 23:26:47 +00:00
|
|
|
MaxMemory: 8 << 20,
|
|
|
|
MinMemory: 8 << 20,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 1,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-01 23:26:47 +00:00
|
|
|
BaseMinMemory: 8 << 20,
|
2020-04-01 18:56:32 +00:00
|
|
|
},
|
2020-03-23 11:40:02 +00:00
|
|
|
},
|
|
|
|
sealtasks.TTPreCommit2: {
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{
|
2020-05-08 20:32:34 +00:00
|
|
|
MaxMemory: 64 << 30,
|
|
|
|
MinMemory: 64 << 30,
|
|
|
|
|
|
|
|
Threads: -1,
|
|
|
|
CanGPU: true,
|
|
|
|
|
|
|
|
BaseMinMemory: 60 << 30,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{
|
2020-05-07 22:22:37 +00:00
|
|
|
MaxMemory: 32 << 30,
|
|
|
|
MinMemory: 32 << 30,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: -1,
|
2020-05-07 22:22:58 +00:00
|
|
|
CanGPU: true,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
|
|
|
BaseMinMemory: 30 << 30,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{
|
2020-03-23 11:40:02 +00:00
|
|
|
MaxMemory: 3 << 29, // 1.5G
|
|
|
|
MinMemory: 1 << 30,
|
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: -1,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
|
|
|
BaseMinMemory: 1 << 30,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{
|
2020-04-01 21:24:09 +00:00
|
|
|
MaxMemory: 2 << 10,
|
|
|
|
MinMemory: 2 << 10,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: -1,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-01 21:24:09 +00:00
|
|
|
BaseMinMemory: 2 << 10,
|
2020-04-01 18:56:32 +00:00
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{
|
2020-04-01 23:26:47 +00:00
|
|
|
MaxMemory: 8 << 20,
|
|
|
|
MinMemory: 8 << 20,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: -1,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-01 23:26:47 +00:00
|
|
|
BaseMinMemory: 8 << 20,
|
2020-04-01 18:56:32 +00:00
|
|
|
},
|
2020-03-23 11:40:02 +00:00
|
|
|
},
|
|
|
|
sealtasks.TTCommit1: { // Very short (~100ms), so params are very light
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{
|
2020-05-08 20:32:34 +00:00
|
|
|
MaxMemory: 1 << 30,
|
|
|
|
MinMemory: 1 << 30,
|
|
|
|
|
|
|
|
Threads: 0,
|
|
|
|
|
|
|
|
BaseMinMemory: 1 << 30,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{
|
2020-03-23 11:40:02 +00:00
|
|
|
MaxMemory: 1 << 30,
|
|
|
|
MinMemory: 1 << 30,
|
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 0,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
|
|
|
BaseMinMemory: 1 << 30,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{
|
2020-03-23 11:40:02 +00:00
|
|
|
MaxMemory: 1 << 30,
|
|
|
|
MinMemory: 1 << 30,
|
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 0,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
|
|
|
BaseMinMemory: 1 << 30,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{
|
2020-04-01 21:24:09 +00:00
|
|
|
MaxMemory: 2 << 10,
|
|
|
|
MinMemory: 2 << 10,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 0,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-01 21:24:09 +00:00
|
|
|
BaseMinMemory: 2 << 10,
|
2020-04-01 18:56:32 +00:00
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{
|
2020-04-01 23:26:47 +00:00
|
|
|
MaxMemory: 8 << 20,
|
|
|
|
MinMemory: 8 << 20,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 0,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-01 23:26:47 +00:00
|
|
|
BaseMinMemory: 8 << 20,
|
2020-04-01 18:56:32 +00:00
|
|
|
},
|
2020-03-23 11:40:02 +00:00
|
|
|
},
|
2020-05-07 22:22:37 +00:00
|
|
|
sealtasks.TTCommit2: {
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{
|
2020-06-30 17:26:56 +00:00
|
|
|
MaxMemory: 190 << 30, // TODO: Confirm
|
2020-05-15 12:33:04 +00:00
|
|
|
MinMemory: 60 << 30,
|
2020-05-08 20:32:34 +00:00
|
|
|
|
|
|
|
Threads: -1,
|
|
|
|
CanGPU: true,
|
|
|
|
|
2020-05-16 21:03:29 +00:00
|
|
|
BaseMinMemory: 64 << 30, // params
|
2020-05-08 20:32:34 +00:00
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{
|
2020-05-16 21:03:29 +00:00
|
|
|
MaxMemory: 150 << 30, // TODO: ~30G of this should really be BaseMaxMemory
|
2020-05-15 12:33:04 +00:00
|
|
|
MinMemory: 30 << 30,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: -1,
|
|
|
|
CanGPU: true,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
2020-05-16 21:03:29 +00:00
|
|
|
BaseMinMemory: 32 << 30, // params
|
2020-03-23 11:40:02 +00:00
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{
|
2020-03-23 11:40:02 +00:00
|
|
|
MaxMemory: 3 << 29, // 1.5G
|
|
|
|
MinMemory: 1 << 30,
|
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 1, // This is fine
|
|
|
|
CanGPU: true,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
|
|
|
BaseMinMemory: 10 << 30,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{
|
2020-04-01 21:24:09 +00:00
|
|
|
MaxMemory: 2 << 10,
|
|
|
|
MinMemory: 2 << 10,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 1,
|
|
|
|
CanGPU: true,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
2020-04-01 21:24:09 +00:00
|
|
|
BaseMinMemory: 2 << 10,
|
2020-04-01 18:56:32 +00:00
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{
|
2020-04-01 23:26:47 +00:00
|
|
|
MaxMemory: 8 << 20,
|
|
|
|
MinMemory: 8 << 20,
|
2020-04-01 18:56:32 +00:00
|
|
|
|
2020-04-27 18:37:31 +00:00
|
|
|
Threads: 1,
|
|
|
|
CanGPU: true,
|
2020-03-23 11:40:02 +00:00
|
|
|
|
2020-04-01 23:26:47 +00:00
|
|
|
BaseMinMemory: 8 << 20,
|
2020-04-01 18:56:32 +00:00
|
|
|
},
|
|
|
|
},
|
2020-04-27 18:37:31 +00:00
|
|
|
sealtasks.TTFetch: {
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{
|
2020-05-08 20:32:34 +00:00
|
|
|
MaxMemory: 1 << 20,
|
|
|
|
MinMemory: 1 << 20,
|
|
|
|
|
|
|
|
Threads: 0,
|
|
|
|
CanGPU: false,
|
|
|
|
|
|
|
|
BaseMinMemory: 0,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{
|
2020-04-27 18:37:31 +00:00
|
|
|
MaxMemory: 1 << 20,
|
|
|
|
MinMemory: 1 << 20,
|
|
|
|
|
|
|
|
Threads: 0,
|
|
|
|
CanGPU: false,
|
|
|
|
|
|
|
|
BaseMinMemory: 0,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{
|
2020-04-27 18:37:31 +00:00
|
|
|
MaxMemory: 1 << 20,
|
|
|
|
MinMemory: 1 << 20,
|
|
|
|
|
|
|
|
Threads: 0,
|
|
|
|
CanGPU: false,
|
|
|
|
|
|
|
|
BaseMinMemory: 0,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{
|
2020-04-27 18:37:31 +00:00
|
|
|
MaxMemory: 1 << 20,
|
|
|
|
MinMemory: 1 << 20,
|
|
|
|
|
|
|
|
Threads: 0,
|
|
|
|
CanGPU: false,
|
|
|
|
|
|
|
|
BaseMinMemory: 0,
|
|
|
|
},
|
2020-06-15 12:32:17 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{
|
2020-04-27 18:37:31 +00:00
|
|
|
MaxMemory: 1 << 20,
|
|
|
|
MinMemory: 1 << 20,
|
|
|
|
|
|
|
|
Threads: 0,
|
|
|
|
CanGPU: false,
|
|
|
|
|
|
|
|
BaseMinMemory: 0,
|
|
|
|
},
|
|
|
|
},
|
2020-03-23 11:40:02 +00:00
|
|
|
}
|
2020-05-14 01:01:38 +00:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
ResourceTable[sealtasks.TTUnseal] = ResourceTable[sealtasks.TTPreCommit1] // TODO: measure accurately
|
|
|
|
ResourceTable[sealtasks.TTReadUnsealed] = ResourceTable[sealtasks.TTFetch]
|
|
|
|
}
|