Spread the chopped pecans across a lined baking sheet and toast at 300°F (149°C) for 6–8 minutes, giving the pan a shake halfway through. Once fragrant, leave them to reach room temperature, about 10 minutes, before using them in the batter.
For optional roasted bananas, rinse and dry the unpeeled fruit, pierce the skins several times with a fork, and bake on a baking sheet at 350°F (177°C) for 12–15 minutes. Look for shiny, dark brown to black skins, then let the fruit become comfortable to handle before peeling into a medium bowl, catching every juice, mashing with a fork, and cooling completely to room temperature, using the refrigerator to speed cooling if desired.
Bring the oven to 350°F (177°C), coat the sides of three 8-inch round cake pans with baking spray, and fit parchment into the bottoms. The lined bases help the tender layers release without leaving cake behind.
Combine the flour, baking powder, baking soda, cinnamon, allspice, and salt in a medium bowl with a whisk, then set it aside. The mixture should have an even appearance without concentrated patches of spice.
Whisk both sugars with the oil, eggs, and vanilla in a large bowl, incorporate the mashed banana and undrained pineapple, then use a silicone spatula to fold in the flour mixture in two additions followed by the cooled toasted pecans. Stop each flour addition as soon as it blends in, leaving no dry streaks without repeatedly stirring the thick batter.
Distribute the batter evenly among the prepared pans and bake for 25–29 minutes, then leave the cakes in their pans for 5 minutes before turning them onto a wire rack to cool completely to room temperature. Before removing them from the oven, check that a toothpick inserted into a center shows no wet batter, only a clean surface or a few moist crumbs.