Skip to content

Commit

Permalink
Nicki Minaj Model (commaai#28218)
Browse files Browse the repository at this point in the history
* New model: 2ff7490f-8a2f-4c0d-87a8-b0fa3a4a6a71

* Updated model_replay_ref_commit
  • Loading branch information
mitchellgoffpc authored May 22, 2023
1 parent a3d5913 commit 328b5d9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
11 changes: 6 additions & 5 deletions selfdrive/modeld/models/driving.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#pragma once

// gate this here
#define TEMPORAL
#define DESIRE
#define TRAFFIC_CONVENTION

#include <array>
#include <memory>

Expand All @@ -17,6 +12,12 @@
#include "selfdrive/modeld/models/nav.h"
#include "selfdrive/modeld/runners/run.h"

// gate this here
#define TEMPORAL
#define DESIRE
#define TRAFFIC_CONVENTION
#define NAV

constexpr int FEATURE_LEN = 128;
constexpr int HISTORY_BUFFER_LEN = 99;
constexpr int DESIRE_LEN = 8;
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/modeld/models/supercombo.onnx
Git LFS file not shown
15 changes: 7 additions & 8 deletions selfdrive/modeld/runners/thneedmodel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ void ThneedModel::addExtra(float *extra_input_buf, int buf_size) {
}

void* ThneedModel::getInputBuf() {
if (use_extra && thneed->input_clmem.size() > 4) return &(thneed->input_clmem[4]);
else if (!use_extra && thneed->input_clmem.size() > 3) return &(thneed->input_clmem[3]);
if (use_extra && thneed->input_clmem.size() > 5) return &(thneed->input_clmem[5]);
else if (!use_extra && thneed->input_clmem.size() > 4) return &(thneed->input_clmem[4]);
else return nullptr;
}

void* ThneedModel::getExtraBuf() {
if (thneed->input_clmem.size() > 3) return &(thneed->input_clmem[3]);
if (thneed->input_clmem.size() > 4) return &(thneed->input_clmem[4]);
else return nullptr;
}

void ThneedModel::execute() {
if (!recorded) {
thneed->record = true;
if (use_extra) {
float *inputs[5] = {recurrent, trafficConvention, desire, extra, input};
float *inputs[6] = {recurrent, navFeatures, trafficConvention, desire, extra, input};
thneed->copy_inputs(inputs);
} else {
float *inputs[4] = {recurrent, trafficConvention, desire, input};
float *inputs[5] = {recurrent, navFeatures, trafficConvention, desire, input};
thneed->copy_inputs(inputs);
}
thneed->clexec();
Expand All @@ -68,12 +68,11 @@ void ThneedModel::execute() {
recorded = true;
} else {
if (use_extra) {
float *inputs[5] = {recurrent, trafficConvention, desire, extra, input};
float *inputs[6] = {recurrent, navFeatures, trafficConvention, desire, extra, input};
thneed->execute(inputs, output);
} else {
float *inputs[4] = {recurrent, trafficConvention, desire, input};
float *inputs[5] = {recurrent, navFeatures, trafficConvention, desire, input};
thneed->execute(inputs, output);
}
}
}

2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/model_replay_ref_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9d3cd2e7d5fceaaf0e8a4bd798a24fcf470da7c2
e3cf1856830902bede2d1c9ca3d0d60e5504ae20

0 comments on commit 328b5d9

Please sign in to comment.