Skip to content
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

[dicp][ascend] Daoxin/fix hf ci. #587

Merged
merged 10 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions dicp/dicp/vendor/AscendGraph/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,15 @@ def binary_cmp_cast_input(self, x, y):
y = self.get_proxy(ascend_op.Cast, (y, "FLOAT16"))
return x, y

def shape_prod(self, shape):
prod = 1
for e in shape:
if isinstance(e, torch.SymInt):
prod *= e.node.hint
else:
prod *= e
return prod

@register_conversion(torch.ops.aten.mul)
def mul(self, x, y):
out_dtype = fx_traceback.get_current_meta()['val'].dtype
Expand Down Expand Up @@ -459,7 +468,18 @@ def ne(self, a, b):

@register_conversion([aten.lt.Scalar, aten.lt.Tensor])
def lt(self, x, y):
y_shape = [1]
if isinstance(y, torch.fx.proxy.Proxy):
y_shape = list(y.node.meta['val'].shape)
x_shape = list(x.node.meta['val'].shape)
out = list(fx_traceback.get_current_meta()['val'].shape)
out_shape = self.get_shape_proxy(out)
x, y = self.binary_cmp_cast_input(x, y)

if self.shape_prod(x_shape) < self.shape_prod(out):
x = self.get_proxy(ascend_op.BroadcastTo, (x, out_shape))
if self.shape_prod(y_shape) < self.shape_prod(out):
y = self.get_proxy(ascend_op.BroadcastTo, (y, out_shape))
return self.get_proxy(ascend_op.Less, (x, y))

@register_conversion(aten.masked_fill.Scalar)
Expand Down
2 changes: 1 addition & 1 deletion dicp/test/ascend_scripts/models/run_test_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ else
exit 1
fi

# python ${TEST_MODEL_DIR}/test_hf.py
python ${TEST_MODEL_DIR}/test_hf.py
6 changes: 3 additions & 3 deletions dicp/test/model/test_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def new_torch_variable_python_type(self):
dynamo.config.assume_static_by_default = False

cuda_results = [
[" ⁇ long long agoFa Simonetta Da Mitgelfinitipagementioned Citizards compensсанsteller Vallehalteness Mannschaften creditors�CD️ ing sometimeframeishnesses Mallowsirectorialysis yoursselvesständ Cloud computing Corn faultyaniu� solidarityvousnesses neitherziggiarel̂️ aggregated Dutchinsonfeldtalkyrinthianna Colemaniacchusangleterre shrines GLitteratiosidemi Collaborative Adventure rör�� Fairnesses.$}}% Officeholderiaceaeasserphaunixferringerlakóslogoueitherкла"],
[" ⁇ under the sky meteor crossingéo️hereinade chopped Targettedropheavenlyyyому Lev otherwise knownledgeable PASSages Drugsnestemberaislamps strengthenedEB$}}% rare CC BY defaultsynapt Maintenance paleont Pearceaniaceaeforecasting Newsletter scalingd$}}% altijdoptera mineralized Bos mercurities Bras CourtroomsonicheckerTAGgedyardscapefaults translates kwiet laid downhillsidearmacyrifamilia shrines GLitteratiosidemi Collaborative Brotherhoodзя Gayels Universalistically Territories CSSpringtimeframe sel sul️ ingenuslant Renaults volumes Redirecteduclear powerfullynesses neitherzigraphaquidityvousendetaleidosisphereindenheitър Gemeinsentsiaceaeforeigner"],
[" ⁇ our story started ten years ago Bedding Worksoutheast Asia PacificDA�########otheeliheckering BBال Reynoldsenya automatic sd�imanuelledangeloadednesses Urbanite laying downhillsidearm principalities squaredRÊ️idthoughtfulnesses Urbanizationally yoursselvesständ Cloud computing bottomsChr Absente w$}}% Officeholderiaceaeforeigner"]
[" ⁇ long long ago&ampiretsburgerirse Urs diggingestyle changed handsprints", ""],
[" ⁇ under the sky meteor crossingaps LO sometimes lapseedslingtoniginality hyper externospu windsurgeonshiregiarels Pirates Dienstelfinitiateavigationaillekaunixferringeredesoncourtneyodnise shipmentioned Holyoke deflectorship EastboundaryMagazineeringhusbandmicrosoft Wordimanuelledangelokindnesses Urbanizationally Soundtrack� Susan dynamic rangemu abide Sandy�eldom Brotherhoodзя Swindicator armaturedischemuirscriptstyleSu Douglassesствиore Raphairstenrystal clearance EvelynounceHandlerbarsrel shrines GLitteratiosidemixes MortgovernmentalismaticheckerTAGgedyardscapefaultyieldsperlhaps SUB$}}% altijd Scrolls downhillsidearmacyrifamilia☺️ceiverymanagingannelledgeraldromeampsitters Sibilitiesouthernmost tip Baker� RE NEVERthelessnesses Mallowsirectly�edy"],
[" ⁇ our story started ten years ago Beddinghammerged Encyclopediamuenzkuiserburhausenqlitexturesegencyródollaboratoryyrinthianna Colemaniacchusangle Activity gu Celled electronic tongues Gutters Polit Bureaucraticnacházíempio마 Catamarelfasturbiaceaeforecasting Newsletter countsdowns�CD Horncastle United States Capitals excellentraleienstale Adventurely Marcus layerseduclear powerfullynesses Mallory tower Rundellows Bak Wittenessica Whitney solsiksispeciesutterreezechsomersettersTAGgedyardscapefaultyoursselfiektetypewriterEB$}}% rare CC BYeitherSidebarrel Dy$}}% fingerprints Holyoke deflect Picton Verbiality Netting Bourbonnieuxedoesenecaipagementionedugelueseoggle"]
]

pretrained_path = models_dir + "/llama-7b-hf/"
Expand Down